RelationManager
Table of Contents
Constants
- ERROR_CODE_BIND_ITEMS_ITEMS_ALREADY_BOUND = 'CRM_BIND_ITEMS_ITEMS_ALREADY_BOUND'
- ERROR_CODE_BIND_ITEMS_TYPES_NOT_BOUND = 'CRM_BIND_ITEMS_TYPES_NOT_BOUND'
- ERROR_CODE_BIND_TYPES_TYPES_ALREADY_BOUND = 'CRM_BIND_TYPES_TYPES_ALREADY_BOUND'
- ERROR_CODE_UNBIND_ITEMS_ITEMS_NOT_BOUND = 'CRM_UNBIND_ITEMS_ITEMS_NOT_BOUND'
- ERROR_CODE_UNBIND_ITEMS_TYPES_NOT_BOUND = 'CRM_UNBIND_ITEMS_TYPES_NOT_BOUND'
- ERROR_CODE_UNBIND_TYPES_RELATION_IS_PREDEFINED = 'CRM_UNBIND_TYPES_RELATION_IS_PREDEFINED'
- ERROR_CODE_UNBIND_TYPES_TYPES_NOT_BOUND = 'CRM_UNBIND_TYPES_TYPES_NOT_BOUND'
- ERROR_CODE_UPDATE_TYPES_RELATION_IS_PREDEFINED = 'CRM_UPDATE_TYPES_RELATION_IS_PREDEFINED'
- ERROR_CODE_UPDATE_TYPES_RELATION_NOT_BOUND = 'CRM_UPDATE_TYPES_RELATION_NOT_FOUND'
- ERROR_CODE_UPDATE_TYPES_RELATION_NOT_FOUND = 'CRM_UPDATE_TYPES_RELATION_NOT_FOUND'
- TAB_NAME_RELATION = 'tab_relation_'
Methods
- areItemsBound() : bool
- Returns true if the items are bound
- areTypesBound() : bool
- Returns true if the types are bound
- bindItems() : Result
- Bind the provided items with each other
- bindTypes() : Result
- Bind the types with each other
- getAvailableForChildBindingEntityTypes() : array<string|int, array<string|int, mixed>>
- getAvailableForParentBindingEntityTypes() : array<string|int, array<string|int, mixed>>
- getChildElements() : array<string|int, ItemIdentifier>
- Returns all ItemIdentifier objects of items that are children to the provided parent The items are collected from all the relations that mention $parent->getEntityTypeId as Relation::getParentEntityTypeID
- getChildRelations() : Collection
- Returns relations in which the provided entityTypeId is mentioned as parent
- getClientFieldEntityTypeIds() : array<string|int, mixed>
- getElements() : array<string|int, ItemIdentifier>
- Returns all ItemIdentifier objects of items that are bound to the provided item The items are collected from all the relations that mention $identifier->getEntityTypeId
- getParentElements() : array<string|int, ItemIdentifier>
- Returns all ItemIdentifier objects of items that are parents to the provided child The items are collected from all the relations that mention $child->getEntityTypeId as Relation::getChildEntityTypeId
- getParentRelations() : Collection
- Returns relations in which the provided entityTypeId is mentioned as child
- getRelation() : Relation|null
- Returns a Relation object that is described by the $identifier.
- getRelations() : Collection
- Returns all relations that mention the provided entityTypeId
- getRelationTabsForDynamicChildren() : array<string|int, mixed>
- unbindItems() : Result
- Unbind the provided items
- unbindTypes() : Result
- Unbind the types
- updateTypesBinding() : Result
Constants
ERROR_CODE_BIND_ITEMS_ITEMS_ALREADY_BOUND
public
mixed
ERROR_CODE_BIND_ITEMS_ITEMS_ALREADY_BOUND
= 'CRM_BIND_ITEMS_ITEMS_ALREADY_BOUND'
ERROR_CODE_BIND_ITEMS_TYPES_NOT_BOUND
public
mixed
ERROR_CODE_BIND_ITEMS_TYPES_NOT_BOUND
= 'CRM_BIND_ITEMS_TYPES_NOT_BOUND'
ERROR_CODE_BIND_TYPES_TYPES_ALREADY_BOUND
public
mixed
ERROR_CODE_BIND_TYPES_TYPES_ALREADY_BOUND
= 'CRM_BIND_TYPES_TYPES_ALREADY_BOUND'
ERROR_CODE_UNBIND_ITEMS_ITEMS_NOT_BOUND
public
mixed
ERROR_CODE_UNBIND_ITEMS_ITEMS_NOT_BOUND
= 'CRM_UNBIND_ITEMS_ITEMS_NOT_BOUND'
ERROR_CODE_UNBIND_ITEMS_TYPES_NOT_BOUND
public
mixed
ERROR_CODE_UNBIND_ITEMS_TYPES_NOT_BOUND
= 'CRM_UNBIND_ITEMS_TYPES_NOT_BOUND'
ERROR_CODE_UNBIND_TYPES_RELATION_IS_PREDEFINED
public
mixed
ERROR_CODE_UNBIND_TYPES_RELATION_IS_PREDEFINED
= 'CRM_UNBIND_TYPES_RELATION_IS_PREDEFINED'
ERROR_CODE_UNBIND_TYPES_TYPES_NOT_BOUND
public
mixed
ERROR_CODE_UNBIND_TYPES_TYPES_NOT_BOUND
= 'CRM_UNBIND_TYPES_TYPES_NOT_BOUND'
ERROR_CODE_UPDATE_TYPES_RELATION_IS_PREDEFINED
public
mixed
ERROR_CODE_UPDATE_TYPES_RELATION_IS_PREDEFINED
= 'CRM_UPDATE_TYPES_RELATION_IS_PREDEFINED'
ERROR_CODE_UPDATE_TYPES_RELATION_NOT_BOUND
public
mixed
ERROR_CODE_UPDATE_TYPES_RELATION_NOT_BOUND
= 'CRM_UPDATE_TYPES_RELATION_NOT_FOUND'
ERROR_CODE_UPDATE_TYPES_RELATION_NOT_FOUND
public
mixed
ERROR_CODE_UPDATE_TYPES_RELATION_NOT_FOUND
= 'CRM_UPDATE_TYPES_RELATION_NOT_FOUND'
TAB_NAME_RELATION
public
mixed
TAB_NAME_RELATION
= 'tab_relation_'
Methods
areItemsBound()
Returns true if the items are bound
public
areItemsBound(ItemIdentifier $parent, ItemIdentifier $child) : bool
Parameters
- $parent : ItemIdentifier
- $child : ItemIdentifier
Return values
boolareTypesBound()
Returns true if the types are bound
public
areTypesBound(RelationIdentifier $identifier) : bool
Parameters
- $identifier : RelationIdentifier
Return values
boolbindItems()
Bind the provided items with each other
public
bindItems(ItemIdentifier $parent, ItemIdentifier $child) : Result
Parameters
- $parent : ItemIdentifier
- $child : ItemIdentifier
Return values
ResultbindTypes()
Bind the types with each other
public
bindTypes(Relation $relation) : Result
Parameters
- $relation : Relation
Return values
ResultgetAvailableForChildBindingEntityTypes()
public
getAvailableForChildBindingEntityTypes([int|null $currentEntityId = null ]) : array<string|int, array<string|int, mixed>>
Parameters
- $currentEntityId : int|null = null
Return values
array<string|int, array<string|int, mixed>> —[entityTypeId => ['title' => string, 'entityTypeId' => int]]
getAvailableForParentBindingEntityTypes()
public
getAvailableForParentBindingEntityTypes([int|null $currentEntityId = null ]) : array<string|int, array<string|int, mixed>>
Parameters
- $currentEntityId : int|null = null
Return values
array<string|int, array<string|int, mixed>> —[entityTypeId => ['title' => string, 'entityTypeId' => int]]
getChildElements()
Returns all ItemIdentifier objects of items that are children to the provided parent The items are collected from all the relations that mention $parent->getEntityTypeId as Relation::getParentEntityTypeID
public
getChildElements(ItemIdentifier $parent) : array<string|int, ItemIdentifier>
Parameters
- $parent : ItemIdentifier
Return values
array<string|int, ItemIdentifier>getChildRelations()
Returns relations in which the provided entityTypeId is mentioned as parent
public
getChildRelations(int $parentEntityTypeId) : Collection
Parameters
- $parentEntityTypeId : int
Return values
CollectiongetClientFieldEntityTypeIds()
public
getClientFieldEntityTypeIds() : array<string|int, mixed>
Return values
array<string|int, mixed>getElements()
Returns all ItemIdentifier objects of items that are bound to the provided item The items are collected from all the relations that mention $identifier->getEntityTypeId
public
getElements(ItemIdentifier $identifier) : array<string|int, ItemIdentifier>
Parameters
- $identifier : ItemIdentifier
Return values
array<string|int, ItemIdentifier>getParentElements()
Returns all ItemIdentifier objects of items that are parents to the provided child The items are collected from all the relations that mention $child->getEntityTypeId as Relation::getChildEntityTypeId
public
getParentElements(ItemIdentifier $child) : array<string|int, ItemIdentifier>
Parameters
- $child : ItemIdentifier
Return values
array<string|int, ItemIdentifier>getParentRelations()
Returns relations in which the provided entityTypeId is mentioned as child
public
getParentRelations(int $childEntityTypeId) : Collection
Parameters
- $childEntityTypeId : int
Return values
CollectiongetRelation()
Returns a Relation object that is described by the $identifier.
public
getRelation(RelationIdentifier $identifier) : Relation|null
If such a Relation was not found, returns null
Parameters
- $identifier : RelationIdentifier
Return values
Relation|nullgetRelations()
Returns all relations that mention the provided entityTypeId
public
getRelations(int $entityTypeId) : Collection
Parameters
- $entityTypeId : int
Return values
CollectiongetRelationTabsForDynamicChildren()
public
getRelationTabsForDynamicChildren(int $parentEntityTypeId, int $parentEntityId[, bool $isNew = false ]) : array<string|int, mixed>
Parameters
- $parentEntityTypeId : int
- $parentEntityId : int
- $isNew : bool = false
Return values
array<string|int, mixed>unbindItems()
Unbind the provided items
public
unbindItems(ItemIdentifier $parent, ItemIdentifier $child) : Result
Parameters
- $parent : ItemIdentifier
- $child : ItemIdentifier
Return values
ResultunbindTypes()
Unbind the types
public
unbindTypes(RelationIdentifier $identifier) : Result
Parameters
- $identifier : RelationIdentifier
Return values
ResultupdateTypesBinding()
public
updateTypesBinding(Relation $relation) : Result
Parameters
- $relation : Relation