- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/Relation/StorageStrategy.php
- Класс: Bitrix\Crm\Relation\StorageStrategy
- Вызов: StorageStrategy::getParentElements
public function getParentElements(ItemIdentifier $child, int $parentEntityTypeId): array;
/**
* Fetch ItemIdentifier objects that are children to the provided parent from the DB.
* Only children with $child->getEntityTypeId() === $childEntityTypeId are returned
*
* @param ItemIdentifier $parent
* @param int $childEntityTypeId
*
* @return ItemIdentifier[]
*/
abstract public function getChildElements(ItemIdentifier $parent, int $childEntityTypeId): array;
/**
* Returns true if the items are bound
*
* @param ItemIdentifier $parent
* @param ItemIdentifier $child
*
* @return bool
*/
abstract public function areItemsBound(ItemIdentifier $parent, ItemIdentifier $child): bool;
/**
* Bind the provided items with each other
*
* @param ItemIdentifier $parent
* @param ItemIdentifier $child
*
* @return Result
*/
public function bindItems(ItemIdentifier $parent, ItemIdentifier $child): Result
{
if ($this->areItemsBound($parent, $child))
{
return (new Result())->addError(new Error(
'The items are bound already',
RelationManager::ERROR_CODE_BIND_ITEMS_ITEMS_ALREADY_BOUND
));
}
return $this->createBinding($parent, $child);
}