Bitrix API

Relation

Table of Contents

Methods

__construct()  : mixed
areItemsBound()  : bool
Returns true if the items are bound
bindItems()  : Result
Bind the provided items with each other
create()  : Relation
Create a new Relation Object
getChildElements()  : array<string|int, ItemIdentifier>
Returns ItemIdentifier objects of elements that are children to the provided parent Only the items that are bound by this relation are taken into account
getChildEntityTypeId()  : int
Returns $entityTypeId of the child type
getIdentifier()  : RelationIdentifier
Returns an identifier that is associated with this relation
getParentElements()  : array<string|int, ItemIdentifier>
Returns ItemIdentifier objects of elements that are parents to the provided child Only the items that are bound by this relation are taken into account
getParentEntityTypeId()  : int
Returns $entityTypeId of the parent type
getSettings()  : Settings
hasEqualIdentifier()  : bool
Returns true if this relation is described by the identifier (has same parent and child entityTypeId)
isChildrenListEnabled()  : bool
Returns true if a list (grid) of child elements, associated with this relation, should be displayed on a parent element details page Always true for predefined relations
isPredefined()  : bool
Returns true if this relation is predefined (set on the system level) and can not be changed, unbound, etc.
replaceAllItemBindings()  : Result
Unbind the provided items
setChildrenListEnabled()  : $this
setSettings()  : self
setStorageStrategy()  : $this
Set a StorageStrategy object, that would be used in methods that communicate with the DB.
unbindItems()  : Result
Unbind the provided items

Methods

__construct()

public __construct(RelationIdentifier $identifier, Settings $settings) : mixed
Parameters
$identifier : RelationIdentifier
$settings : Settings

areItemsBound()

Returns true if the items are bound

public areItemsBound(ItemIdentifier $parent, ItemIdentifier $child) : bool
Parameters
$parent : ItemIdentifier
$child : ItemIdentifier
Return values
bool

bindItems()

Bind the provided items with each other

public bindItems(ItemIdentifier $parent, ItemIdentifier $child) : Result
Parameters
$parent : ItemIdentifier
$child : ItemIdentifier
Return values
Result

create()

Create a new Relation Object

public static create(int $parentEntityTypeId, int $childEntityTypeId[, bool $isChildrenListEnabled = true ]) : Relation
Parameters
$parentEntityTypeId : int
$childEntityTypeId : int
$isChildrenListEnabled : bool = true
Return values
Relation

getChildElements()

Returns ItemIdentifier objects of elements that are children to the provided parent Only the items that are bound by this relation are taken into account

public getChildElements(ItemIdentifier $parent) : array<string|int, ItemIdentifier>
Parameters
$parent : ItemIdentifier
Return values
array<string|int, ItemIdentifier>

getChildEntityTypeId()

Returns $entityTypeId of the child type

public getChildEntityTypeId() : int
Return values
int

getIdentifier()

Returns an identifier that is associated with this relation

public getIdentifier() : RelationIdentifier
Return values
RelationIdentifier

getParentElements()

Returns ItemIdentifier objects of elements that are parents to the provided child Only the items that are bound by this relation are taken into account

public getParentElements(ItemIdentifier $child) : array<string|int, ItemIdentifier>
Parameters
$child : ItemIdentifier
Return values
array<string|int, ItemIdentifier>

getParentEntityTypeId()

Returns $entityTypeId of the parent type

public getParentEntityTypeId() : int
Return values
int

getSettings()

public getSettings() : Settings
Return values
Settings

hasEqualIdentifier()

Returns true if this relation is described by the identifier (has same parent and child entityTypeId)

public hasEqualIdentifier(RelationIdentifier $identifier) : bool
Parameters
$identifier : RelationIdentifier
Return values
bool

isChildrenListEnabled()

Returns true if a list (grid) of child elements, associated with this relation, should be displayed on a parent element details page Always true for predefined relations

public isChildrenListEnabled() : bool
Return values
bool

isPredefined()

Returns true if this relation is predefined (set on the system level) and can not be changed, unbound, etc.

public isPredefined() : bool
Return values
bool

replaceAllItemBindings()

Unbind the provided items

public replaceAllItemBindings(ItemIdentifier $oldItem, ItemIdentifier $newItem) : Result
Parameters
$oldItem : ItemIdentifier
$newItem : ItemIdentifier
Return values
Result

setChildrenListEnabled()

public setChildrenListEnabled(bool $isChildrenListEnabled) : $this
Parameters
$isChildrenListEnabled : bool
Return values
$this

setSettings()

public setSettings(Settings $settings) : self
Parameters
$settings : Settings
Return values
self

setStorageStrategy()

Set a StorageStrategy object, that would be used in methods that communicate with the DB.

public setStorageStrategy(StorageStrategy $storageStrategy) : $this

(Relation::areItemsBound, Relation::bindItems, etc.)

Parameters
$storageStrategy : StorageStrategy
Return values
$this

unbindItems()

Unbind the provided items

public unbindItems(ItemIdentifier $parent, ItemIdentifier $child) : Result
Parameters
$parent : ItemIdentifier
$child : ItemIdentifier
Return values
Result

        
On this page

Search results