• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/entitypropertyvaluecollection.php
  • Класс: BitrixSaleEntityPropertyValueCollection
  • Вызов: EntityPropertyValueCollection::refreshRelated
public function refreshRelated(): void
{
	/** @var EntityPropertyValue $propertyValueClassName*/
    $propertyValueClassName = static::getPropertyValueClassName();
	$props = $propertyValueClassName::loadForEntity($this->getEntityParent());

	/** @var EntityPropertyValue $propertyValue */
	foreach ($this->collection as $propertyValue)
	{
		if (!$propertyValue->needDeleteOnRefresh())
		{
			continue;
		}

		if ($propertyValue->getId() <= 0
			&& !isset($props[$propertyValue->getPropertyId()])
		)
		{
			$propertyValue->delete();
		}
	}

	/** @var EntityPropertyValue $propertyValue */
	foreach ($props as $propertyValue)
	{
		if (!$this->getItemByOrderPropertyId($propertyValue->getPropertyId()))
		{
			$propertyValue->setCollection($this);
			$this->addItem($propertyValue);
		}
	}
}