CoolCMS API

ParentRef
in package

FinalYes

Marks a single association that is a back-reference to the owning parent (Doctrine ManyToOne with `inversedBy`), for {@see \App\Core\Utils\Hydrators\EntityHydrator}.

extract() skips such a relation to avoid cycles, because the parent already carries the child. The exception is a property that is also #[Identity] (derived identity): it stays in the payload, otherwise the child would lose its own identity.

Usage:

#[ParentRef]
protected ?Gallery $gallery;
Attributes
#[Attribute]
\Attribute::TARGET_PROPERTY

Table of Contents

On this page
  • Table Of Contents

Search results