Repository navigation
DateRange
Viames Marino edited this page Sep 30, 2026
·
2 revisions
Pair\Helpers\DateRange is an immutable value object for half-open date-time intervals [start, end): the start is included and the end is excluded.
contains(DateTimeInterface $dt): booloverlaps(DateRange $other): boolintersection(DateRange $other): ?DateRangeexpand(?DateInterval $before = null, ?DateInterval $after = null): DateRange-
shift(DateInterval $delta): DateRange,shiftBy(string $modifier): DateRange forMonth(), previousMonth(), nextMonth()toArray(string $format = 'Y-m-d H:i:s'): array-
toSqlParams(...): array,toSqlWhere(string $column, ...): string toPeriod(DateInterval $step, int $options = 0): DatePeriod
$range = new \Pair\Helpers\DateRange(
new DateTimeImmutable('2026-02-01 00:00:00'),
new DateTimeImmutable('2026-03-01 00:00:00')
);
$where = $range->toSqlWhere('created_at');
$params = $range->toSqlParams();
$orders = \Pair\Orm\Query::table('orders')
->whereRaw($where, $params)
->get();- Constructor validates
start < end. - Supports month helpers and localization-aware formatting methods.
See also: Query, QueryFilter.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4