nextras / orm-brick-date-time
Nextras Orm's integration for Brick/DateTime
Fund package maintenance!
hrach
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/nextras/orm-brick-date-time
Requires
- php: >8.1
- brick/date-time: ~0.8
- nextras/orm: dev-js/orm-configurator-extension
Requires (Dev)
- nette/tester: ^2.5
- phpstan/phpstan: 2.1.40
This package is auto-updated.
Last update: 2026-03-01 13:13:21 UTC
README
Property wrappers and ORM extension integrating brick/date-time types with Nextras ORM.
Supported Types
| PHP type | MySQL Storage | Postgres Storage | DBAL modifier |
|---|---|---|---|
Brick\DateTime\Instant |
TIMESTAMP |
TIMESTAMPTZ |
%dt |
Brick\DateTime\LocalDateTime |
DATETIME |
TIMESTAMP |
%ldt |
Brick\DateTime\LocalDate |
DATE / VARCHAR |
DATE / VARCHAR |
%s |
Installation
composer require nextras/orm-brick-date-time
Usage
Register the extension in your Nette configuration. Typically, using NEON configuration:
extensions: nextras.orm: Nextras\Orm\Bridges\NetteDI\OrmExtension nextras.orm: extensions: @Nextras\OrmBrickDateTime\OrmBrickDateTimeExtension services: - Nextras\OrmBrickDateTime\OrmBrickDateTimeExtension
Then use brick/date-time types in your entity property annotations:
use Brick\DateTime\Instant; use Brick\DateTime\LocalDate; use Brick\DateTime\LocalDateTime; use Nextras\Orm\Entity\Entity; /** * @property int $id * @property Instant $createdAt * @property Instant|null $deletedAt * @property LocalDate $bornOn * @property LocalDateTime $scheduledAt */ class User extends Entity { }
The extension automatically:
- assigns the correct property wrapper based on the declared type,
- configures the DBAL column modifier so values are persisted correctly.
License
MIT. See full license.