TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
DependencyResolver Class Reference

Public Member Functions

 setWorkspace ($workspace)
 
 getWorkspace ()
 
 setEventCallback ($eventName,\TYPO3\CMS\Version\Dependency\EventCallback $callback)
 
 setOuterMostParentsRequireReferences ($outerMostParentsRequireReferences)
 
 addElement ($table, $id, array $data=[])
 
 getNestedElements (\TYPO3\CMS\Version\Dependency\ElementEntity $outerMostParent)
 
 getElements ()
 
 getFactory ()
 

Protected Member Functions

 processOuterMostParent (\TYPO3\CMS\Version\Dependency\ElementEntity $element)
 

Protected Attributes

 $workspace = 0
 
 $factory
 
 $elements = []
 
 $eventCallbacks = []
 
 $outerMostParentsRequireReferences = false
 
 $outerMostParents
 

Detailed Description

Object to handle and determine dependent references of elements.

Definition at line 20 of file version/Classes/Dependency/DependencyResolver.php.

Member Function Documentation

addElement (   $table,
  $id,
array  $data = [] 
)

Adds an element to be checked for dependent references.

Parameters
string$table
int$id
array$data
Returns

Definition at line 123 of file version/Classes/Dependency/DependencyResolver.php.

References DependencyResolver\getFactory().

getElements ( )

Gets the registered elements.

Returns
array

Definition at line 189 of file version/Classes/Dependency/DependencyResolver.php.

References DependencyResolver\$elements.

getFactory ( )

Gets an instance of the factory to keep track of element or reference entities.

Returns

Definition at line 199 of file version/Classes/Dependency/DependencyResolver.php.

References DependencyResolver\$factory, and GeneralUtility\makeInstance().

Referenced by DependencyResolver\addElement().

getNestedElements ( \TYPO3\CMS\Version\Dependency\ElementEntity  $outerMostParent)

Gets all nested elements (including the parent) of a particular outermost parent element.

Exceptions
RuntimeException
Parameters
\TYPO3\CMS\Version\Dependency\ElementEntity$outerMostParent
Returns
array

Definition at line 174 of file version/Classes/Dependency/DependencyResolver.php.

getWorkspace ( )

Gets the current workspace.

Returns
int

Definition at line 67 of file version/Classes/Dependency/DependencyResolver.php.

References DependencyResolver\$workspace.

processOuterMostParent ( \TYPO3\CMS\Version\Dependency\ElementEntity  $element)
protected

Processes and registers the outermost parents accordant to the registered elements.

Parameters
\TYPO3\CMS\Version\Dependency\ElementEntity$element
Returns
void

Definition at line 154 of file version/Classes/Dependency/DependencyResolver.php.

setEventCallback (   $eventName,
\TYPO3\CMS\Version\Dependency\EventCallback  $callback 
)

Sets a callback for a particular event.

Parameters
string$eventName
\TYPO3\CMS\Version\Dependency\EventCallback$callback
Returns

Definition at line 79 of file version/Classes/Dependency/DependencyResolver.php.

setOuterMostParentsRequireReferences (   $outerMostParentsRequireReferences)

Sets the condition that outermost parents required at least one child or parent reference.

Parameters
bool$outerMostParentsRequireReferences
Returns

Definition at line 109 of file version/Classes/Dependency/DependencyResolver.php.

References DependencyResolver\$outerMostParentsRequireReferences.

setWorkspace (   $workspace)

Sets the current workspace.

Parameters
int$workspace

Definition at line 57 of file version/Classes/Dependency/DependencyResolver.php.

References DependencyResolver\$workspace.

Member Data Documentation

$elements = []
protected
$eventCallbacks = []
protected
$factory
protected
$outerMostParents
protected
$outerMostParentsRequireReferences = false
protected
$workspace = 0
protected