phpbotgram

NullableObjectField extends BaseField
in package

FinalYes

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

$chain  : MagicFilter

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

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
Filter
On this page

Search results