NullableStringField
extends BaseField
in package
Typed F-DSL wrapper for nullable string fields (`?string` — most of the optional text fields on `Message`, `User`, …). Mirrors the `StringField` comparator surface and adds two presence-tests (`isSet` / `isNull`) so callers can express null-checks without dropping into raw MagicFilter.
Mirrors the design spec § "Magic-filter runtime + F-DSL" NullableStringField surface.
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.
- contains() : Filter
- Substring check. Reject when the field is null.
- endsWith() : Filter
- Suffix check. Reject when the field is null.
- equals() : Filter
- Exact-match comparator. Reject when the field is null.
- in() : Filter
- Set-membership across a string list. Reject when the field is null.
- isNull() : Filter
- Mirror of `isSet`: accept when the field is null.
- isSet() : Filter
- Accept when the field is non-null. Implemented via `notEquals(null)` so the chain treats the field's actual value as the running value and produces a clean bool verdict.
- startsWith() : Filter
- Prefix check. Reject when the field is 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
Filtercontains()
Substring check. Reject when the field is null.
public
contains(string $needle) : Filter
Parameters
- $needle : string
Return values
FilterendsWith()
Suffix check. Reject when the field is null.
public
endsWith(string $suffix) : Filter
Parameters
- $suffix : string
Return values
Filterequals()
Exact-match comparator. Reject when the field is null.
public
equals(string $value) : Filter
Parameters
- $value : string
Return values
Filterin()
Set-membership across a string list. Reject when the field is null.
public
in(array<int, string> $values) : Filter
Parameters
- $values : array<int, string>
Return values
FilterisNull()
Mirror of `isSet`: accept when the field is null.
public
isNull() : Filter
Return values
FilterisSet()
Accept when the field is non-null. Implemented via `notEquals(null)` so the chain treats the field's actual value as the running value and produces a clean bool verdict.
public
isSet() : Filter
Return values
FilterstartsWith()
Prefix check. Reject when the field is null.
public
startsWith(string $prefix) : Filter
Parameters
- $prefix : string