Bitrix API

EntityBinding extends StorageStrategy

Table of Contents

Methods

__construct()  : mixed
EntityBinding constructor.
areItemsBound()  : bool
Returns true if the items are bound
bindItems()  : Result
Bind the provided items with each other
getChildElements()  : array<string|int, ItemIdentifier>
Fetch ItemIdentifier objects that are children to the provided parent from the DB.
getParentElements()  : array<string|int, ItemIdentifier>
Fetch ItemIdentifier objects that are parents to the provided child from the DB.
replaceAllItemBindings()  : Result
Replace all bindings of $oldItem to $newItem
unbindItems()  : Result
Unbind the provided items

Methods

__construct()

EntityBinding constructor.

public __construct(callable $getParentIds, callable $getChildIds, callable $bindParentIds, callable $unbindParentIds, callable $replaceBindings) : mixed
Parameters
$getParentIds : callable

function(int $childEntityId): int[]

$getChildIds : callable

function(int $parentEntityId): int[]

$bindParentIds : callable

function(int $childEntityId, int[] $parentIds): void

$unbindParentIds : callable

function(int $childEntityId, int[] $parentIds): void

$replaceBindings : callable

function(int $childEntityId, int $parentEntityId): void

areItemsBound()

Returns true if the items are bound

public areItemsBound(ItemIdentifier $parent, ItemIdentifier $child) : bool
Parameters
$parent : ItemIdentifier
$child : ItemIdentifier
Tags
inheritDoc
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

getChildElements()

Fetch ItemIdentifier objects that are children to the provided parent from the DB.

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

getParentElements()

Fetch ItemIdentifier objects that are parents to the provided child from the DB.

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

replaceAllItemBindings()

Replace all bindings of $oldItem to $newItem

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

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