DependencyResolver
class \
Object to handle and determine dependent references of elements.
Internal
Table of Contents
Properties
- $elements : array
- $eventCallbacks : array
- $factory : DependencyEntityFactory|null
- $outerMostParents : array|null
- $workspace : int
Methods
- addElement() : ElementEntity
- Adds an element to be checked for dependent references.
- executeEventCallback() : mixed
- Executes a registered callback (if any) for a particular event.
- getElements() : array
- Gets the registered elements.
- getFactory() : DependencyEntityFactory
- Gets an instance of the factory to keep track of element or reference entities.
- getNestedElements() : array
- Gets all nested elements (including the parent) of a particular outermost parent element.
- getOuterMostParents() : ElementEntity[]
- Gets the outermost parents that define complete dependent structure each.
- getWorkspace() : int
- Gets the current workspace.
- setEventCallback() : self
- Sets a callback for a particular event.
- setWorkspace() : void
- Sets the current workspace.
- processOuterMostParent() : void
- Processes and registers the outermost parents accordant to the registered elements.
Properties
$elements
protected
array
$elements
= []
$eventCallbacks
protected
array
$eventCallbacks
= []
$factory
protected
DependencyEntityFactory|null
$factory
$outerMostParents
protected
array|null
$outerMostParents
$workspace
protected
int
$workspace
= 0
Methods
addElement()
Adds an element to be checked for dependent references.
public
addElement(string $table, int $id[, array $data = [] ]) : ElementEntity
Parameters
- $table : string
- $id : int
- $data : array = []
Return values
ElementEntityexecuteEventCallback()
Executes a registered callback (if any) for a particular event.
public
executeEventCallback(string $eventName, object $caller[, array $callerArguments = [] ]) : mixed
Parameters
- $eventName : string
- $caller : object
- $callerArguments : array = []
getElements()
Gets the registered elements.
public
getElements() : array
Return values
arraygetFactory()
Gets an instance of the factory to keep track of element or reference entities.
public
getFactory() : DependencyEntityFactory
Return values
DependencyEntityFactorygetNestedElements()
Gets all nested elements (including the parent) of a particular outermost parent element.
public
getNestedElements(ElementEntity $outerMostParent) : array
Parameters
- $outerMostParent : ElementEntity
Return values
arraygetOuterMostParents()
Gets the outermost parents that define complete dependent structure each.
public
getOuterMostParents() : ElementEntity[]
Return values
ElementEntity[]getWorkspace()
Gets the current workspace.
public
getWorkspace() : int
Return values
intsetEventCallback()
Sets a callback for a particular event.
public
setEventCallback(string $eventName, EventCallback $callback) : self
Parameters
- $eventName : string
- $callback : EventCallback
Return values
selfsetWorkspace()
Sets the current workspace.
public
setWorkspace(int $workspace) : void
Parameters
- $workspace : int
processOuterMostParent()
Processes and registers the outermost parents accordant to the registered elements.
protected
processOuterMostParent(ElementEntity $element) : void
Parameters
- $element : ElementEntity