Compatible extends StorageStrategy
Table of Contents
Methods
- __construct() : mixed
- Compatible 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()
Compatible constructor.
public
__construct(string $compatibleChildEntityClass, string $parentIdFieldName) : mixed
Parameters
- $compatibleChildEntityClass : string
- $parentIdFieldName : string
areItemsBound()
Returns true if the items are bound
public
areItemsBound(ItemIdentifier $parent, ItemIdentifier $child) : bool
Parameters
- $parent : ItemIdentifier
- $child : ItemIdentifier
Tags
Return values
boolbindItems()
Bind the provided items with each other
public
bindItems(ItemIdentifier $parent, ItemIdentifier $child) : Result
Parameters
- $parent : ItemIdentifier
- $child : ItemIdentifier
Return values
ResultgetChildElements()
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
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
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
ResultunbindItems()
Unbind the provided items
public
unbindItems(ItemIdentifier $parent, ItemIdentifier $child) : Result
Parameters
- $parent : ItemIdentifier
- $child : ItemIdentifier