NullableObjectField
extends BaseField
in package
Typed F-DSL wrapper for nullable nested-object fields (`?User`, `?Message`, …). Only exposes presence-tests because deeper predicates are object-type-specific and belong on per-type sub-builders emitted by codegen (`MessageF::fromUser()` → `NullableObjectField`).
Users who want to drill into the nested object after a presence-test
compose: Filter::all(MessageF::fromUser()->isSet(), MessageF::fromUser()->id()->equals(123)) — the second filter pulls
a fresh chain from the typed-builder factory and applies its own
predicates against the nested object.
Mirrors the design spec § "Magic-filter runtime + F-DSL"
NullableObjectField<T> surface (the generic parameter is documented in
the spec but not expressible in PHP's type system — the underlying
chain is mixed until codegen specializes the wrappers).
Table of Contents
Properties
Methods
- __construct() : mixed
- Hold the chain handle directly: codegen passes a freshly-rooted chain (e.g. `MagicFilter::root()->text`) and subclass methods clone-and- extend it via the chain's immutable append semantics.
- asFilter() : Filter
- Bridge the wrapped chain to a `Filter`. Used by callers that want the raw chain verdict without going through a typed comparator — e.g. an existence check on a nullable-typed field where the underlying `MagicFilter::asFilter()` reject-on-null behaviour is exactly what the user wants.
- isNull() : Filter
- Accept when the nested object is null.
- isSet() : Filter
- Accept when the nested object is non-null.
Properties
$chain read-only
public
MagicFilter
$chain
Methods
__construct()
Hold the chain handle directly: codegen passes a freshly-rooted chain (e.g. `MagicFilter::root()->text`) and subclass methods clone-and- extend it via the chain's immutable append semantics.
public
__construct(MagicFilter $chain) : mixed
Parameters
- $chain : MagicFilter
asFilter()
Bridge the wrapped chain to a `Filter`. Used by callers that want the raw chain verdict without going through a typed comparator — e.g. an existence check on a nullable-typed field where the underlying `MagicFilter::asFilter()` reject-on-null behaviour is exactly what the user wants.
public
asFilter() : Filter
Returns a MagicFilterAsFilter instance under the hood; see
MagicFilterAsFilter for the bool|array acceptance contract.
Return values
FilterisNull()
Accept when the nested object is null.
public
isNull() : Filter
Return values
FilterisSet()
Accept when the nested object is non-null.
public
isSet() : Filter