phpbotgram

DateTimeField extends BaseField
in package

FinalYes

Typed F-DSL wrapper for `\DateTime`-valued Telegram fields (`Message::$date`, `Message::$editDate`, …). The temporal helpers delegate to MagicFilter's numeric comparators, which use PHP's native `<`/`>`-on-DateTime semantics — DateTime instances compare by their canonical timestamp.

Mirrors the design spec § "Magic-filter runtime + F-DSL" DateTimeField surface.

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.
after()  : Filter
Accept when the field's value is strictly after `$when`.
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.
before()  : Filter
Accept when the field's value is strictly before `$when`.
between()  : Filter
Inclusive temporal range: accept when `$from <= $value <= $to`.

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

after()

Accept when the field's value is strictly after `$when`.

public after(DateTimeInterface $when) : Filter
Parameters
$when : DateTimeInterface
Return values
Filter

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

before()

Accept when the field's value is strictly before `$when`.

public before(DateTimeInterface $when) : Filter
Parameters
$when : DateTimeInterface
Return values
Filter

between()

Inclusive temporal range: accept when `$from <= $value <= $to`.

public between(DateTimeInterface $from, DateTimeInterface $to) : Filter

Composes gte+lte under an AndFilter — same pattern as IntField::between.

Parameters
$from : DateTimeInterface
$to : DateTimeInterface
Return values
Filter
On this page

Search results