Download the PHP package chamber-orchestra/doctrine-extensions-bundle without Composer
On this page you can find all versions of the php package chamber-orchestra/doctrine-extensions-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chamber-orchestra/doctrine-extensions-bundle
More information about chamber-orchestra/doctrine-extensions-bundle
Files in chamber-orchestra/doctrine-extensions-bundle
Package doctrine-extensions-bundle
Short Description Lightweight Symfony Doctrine ORM extensions for PostgreSQL — entity traits, soft-delete filter, repository base classes, decimal type, random() DQL
License MIT
Informations about the package doctrine-extensions-bundle
Chamber Orchestra Doctrine Extensions Bundle
Lightweight Symfony bundle providing reusable Doctrine ORM extensions for PostgreSQL: entity traits with matching contract interfaces, a soft-delete SQL filter, extended repository base classes, a custom decimal DBAL type, and a random() DQL function.
Requirements
- PHP ^8.5
- Symfony 8.0
- Doctrine ORM 3 / DoctrineBundle 3.2
- PostgreSQL
Installation
If you are not using Symfony Flex:
Features
Entity Traits & Contract Interfaces
Each trait has a corresponding interface in Contracts\Entity. Implement the interface and use the trait:
| Trait | Interface | Fields & Methods |
|---|---|---|
IdTrait |
IdInterface |
UUID primary key (caller-assigned). getId(): Uuid |
GeneratedIdTrait |
GeneratedIdInterface |
UUID primary key (auto-generated, nullable before persist). getId(): ?Uuid |
SoftDeleteTrait |
SoftDeleteInterface |
deletedDatetime column. isDeleted(), delete(), restore() |
ToggleTrait |
ToggleInterface |
enabled boolean column. isEnabled(), toggle(), enable(), disable() |
VersionTrait |
— | Doctrine @Version column using DatePoint (microsecond precision). getVersion() |
Soft-Delete Filter
Automatically appends deleted_datetime IS NULL to queries for entities implementing SoftDeleteInterface. Bypass per entity when needed:
Repository Base Classes
Two base classes provide getOneBy() and indexBy() out of the box:
ServiceEntityRepository— extends Doctrine bundle'sServiceEntityRepository, adds$cacheableparameter tocreateQueryBuilder()EntityRepository— extends Doctrine ORM'sEntityRepository, implementsServiceEntityRepositoryInterface
Custom Decimal DBAL Type
DecimalType overrides Doctrine's DecimalType to ensure convertToPHPValue() always returns ?string with scalar type validation.
DQL Random Function (PostgreSQL)
Maps random() DQL to PostgreSQL random():
Testing
License
MIT
All versions of doctrine-extensions-bundle with dependencies
symfony/dependency-injection Version 8.0.*
symfony/config Version 8.0.*
symfony/framework-bundle Version 8.0.*
symfony/runtime Version 8.0.*
symfony/clock Version 8.0.*
symfony/uid Version 8.0.*
doctrine/orm Version ^3.0
doctrine/doctrine-bundle Version 3.2.*