IsReferenceConsideredForDependencyEvent 

The PSR-14 event \TYPO3\CMS\Workspaces\Event\IsReferenceConsideredForDependencyEvent is dispatched per sys_refindex row when the workspace dependency resolver evaluates which references constitute structural dependencies during publish, stage change, discard, or display operations.

References are opt-in: a reference is not considered a dependency unless a listener explicitly marks it as one via setDependency() . TYPO3 Core registers a listener that marks type=inline, type=file (with foreign_field), and type=flex fields as dependencies; this event allows extensions to opt in additional custom fields, for example those storing a parent-child relationship outside of TCA's built-in relation types.

Example: Treat a custom parent-reference field as a dependency 

The following listener marks a custom tx_container_parent field on the tt_content table as a workspace dependency, so that publishing, staging, or discarding a child record also considers its parent:

EXT:my_extension/Classes/EventListener/MarkContainerParentAsWorkspaceDependencyListener.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\EventListener;

use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Workspaces\Event\IsReferenceConsideredForDependencyEvent;

#[AsEventListener(identifier: 'my-extension/mark-container-parent-as-workspace-dependency')]
final readonly class MarkContainerParentAsWorkspaceDependencyListener
{
  public function __invoke(IsReferenceConsideredForDependencyEvent $event): void
  {
    if ($event->getTableName() !== 'tt_content' || $event->getFieldName() !== 'tx_container_parent') {
      return;
    }
    $event->setDependency(true);
  }
}
Copied!

API 

final class IsReferenceConsideredForDependencyEvent
Fully qualified name
\TYPO3\CMS\Workspaces\Event\IsReferenceConsideredForDependencyEvent

Event dispatched per sys_refindex row when evaluating workspace dependencies. Listeners decide whether a given reference constitutes a structural workspace dependency.

References are opt-in: isDependency defaults to false and listeners must explicitly mark relevant references as dependencies.

getTableName()
Returns
string
getRecordId()
Returns
int
getFieldName()
Returns
string
getReferenceTable()
Returns
string
getReferenceId()
Returns
int
getAction()
Returns
\TYPO3\CMS\Workspaces\Dependency\DependencyCollectionAction
getWorkspaceId()
Returns
int
getFlexPointer()

Path of the FlexForm field the reference originates from (sys_refindex.flexpointer), empty if the reference does not originate from a FlexForm.

Returns
string
getSoftReferenceKey()

Key of the soft reference parser that found the reference (sys_refindex.softref_key), empty if the reference is no soft reference.

Returns
string
getSoftReferenceId()

Identifier of the soft reference in the field value (sys_refindex.softref_id), empty if the reference is no soft reference.

Returns
string
isSoftReference()
Returns
bool
getDirection()

Whether the reference is followed to collect children of the record owning the field, or parents of the referenced record.

Returns
\TYPO3\CMS\Workspaces\Dependency\DependencyLookupDirection
setDependency(bool $isDependency)
param $isDependency

the isDependency

isDependency()
Returns
bool