2 namespace TYPO3\CMS\Version\Dependency;
24 const EVENT_Construct =
'TYPO3\\CMS\\Version\\Dependency\\ElementEntity::construct';
27 const RESPONSE_Skip =
'TYPO3\\CMS\\Version\\Dependency\\ElementEntity->skip';
98 $this->dependency->executeEventCallback(self::EVENT_Construct, $this);
144 $this->
id = (int)
$id;
167 $result = $this->data[$key];
181 $this->data[$key] = $value;
192 return isset($this->data[$key]);
202 return self::getIdentifier($this->table, $this->
id);
222 if (!isset($this->children)) {
223 $this->children = array();
224 $where =
'tablename=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($this->table,
'sys_refindex') .
' AND recuid='
225 . $this->
id .
' AND workspace=' . $this->dependency->getWorkspace();
226 $rows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'*',
'sys_refindex', $where,
'',
'sorting');
227 if (is_array($rows)) {
228 foreach ($rows as $row) {
229 if ($row[
'ref_table'] !==
'_FILE' && $row[
'ref_table'] !==
'_STRING') {
231 'table' => $row[
'ref_table'],
232 'id' => $row[
'ref_uid'],
233 'field' => $row[
'field'],
234 'scope' => self::REFERENCES_ChildOf
237 $callbackResponse = $this->dependency->executeEventCallback(self::EVENT_CreateChildReference, $this, $arguments);
238 if ($callbackResponse !== self::RESPONSE_Skip) {
239 $this->children[] = $this->
getDependency()->getFactory()->getReferencedElement(
261 if (!isset($this->parents)) {
262 $this->parents = array();
263 $where =
'ref_table=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($this->table,
'sys_refindex')
264 .
' AND deleted=0 AND ref_uid=' . $this->
id .
' AND workspace=' . $this->dependency->getWorkspace();
265 $rows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'*',
'sys_refindex', $where,
'',
'sorting');
266 if (is_array($rows)) {
267 foreach ($rows as $row) {
268 $arguments = array(
'table' => $row[
'tablename'],
'id' => $row[
'recuid'],
'field' => $row[
'field'],
'scope' => self::REFERENCES_ParentOf);
269 $callbackResponse = $this->dependency->executeEventCallback(self::EVENT_CreateParentReference, $this, $arguments);
270 if ($callbackResponse !== self::RESPONSE_Skip) {
271 $this->parents[] = $this->
getDependency()->getFactory()->getReferencedElement(
300 public function getOuterMostParent()
302 if (!isset($this->outerMostParent)) {
305 $this->outerMostParent = $this;
307 $this->outerMostParent =
false;
311 if (
$outerMostParent instanceof \TYPO3\CMS\Version\Dependency\ElementEntity) {
328 public function getNestedChildren()
330 if (!isset($this->nestedChildren)) {
331 $this->nestedChildren = array();
335 $this->nestedChildren = array_merge($this->nestedChildren, array($child->getElement()->__toString() => $child->getElement()), $child->getElement()->getNestedChildren());
360 if (empty($this->record[
'uid']) || (
int)$this->record[
'uid'] !== $this->
getId()) {
361 $this->record = array();
362 $row =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
'uid,pid,t3ver_wsid,t3ver_state,t3ver_oid', $this->
getTable(),
'uid=' . $this->
getId());
363 if (is_array($row)) {
364 $this->record = $row;