BoolField
extends BaseField
in package
Typed F-DSL wrapper for boolean Telegram fields (`User::$isPremium`, `Message::$isTopicMessage`, …). Surfaces only the two truth-value comparators so call sites read as `MessageF::isTopicMessage()->isTrue()` rather than `equals(true)`.
Mirrors the design spec § "Magic-filter runtime + F-DSL" BoolField 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.
- isFalse() : Filter
- Mirror of `isTrue` for the falsy verdict.
- isTrue() : Filter
- Accept when the field's value is exactly `true`. The chain uses MagicFilter's `==` comparator so `1`-typed payloads wouldn't be accepted — but Telegram's schema only emits real booleans here.
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
FilterisFalse()
Mirror of `isTrue` for the falsy verdict.
public
isFalse() : Filter
Return values
FilterisTrue()
Accept when the field's value is exactly `true`. The chain uses MagicFilter's `==` comparator so `1`-typed payloads wouldn't be accepted — but Telegram's schema only emits real booleans here.
public
isTrue() : Filter