Download the PHP package alesitom/hybrid-id-doctrine without Composer
On this page you can find all versions of the php package alesitom/hybrid-id-doctrine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alesitom/hybrid-id-doctrine
More information about alesitom/hybrid-id-doctrine
Files in alesitom/hybrid-id-doctrine
Package hybrid-id-doctrine
Short Description Doctrine integration for HybridId — DBAL type and ORM ID generator
License MIT
Informations about the package hybrid-id-doctrine
HybridId for Doctrine
Doctrine integration for HybridId — DBAL type and ORM ID generator for compact, time-sortable unique IDs.
Installation
Setup
Register the DBAL type in your application bootstrap:
For Symfony, add to config/packages/doctrine.yaml:
Entity Mapping
Prefixes
Add a static hybridIdPrefix() method to your entity for Stripe-style prefixed IDs:
Custom Generator Configuration
For custom profiles or explicit node assignment, register a pre-configured generator as a service:
In Symfony, register as a service:
Column Sizing
The default column length is 29 (standard profile + max 8-char prefix + underscore). Adjust based on your profile:
| Profile | No prefix | With prefix (max 8) |
|---|---|---|
compact |
length: 16 |
length: 25 |
standard |
length: 20 |
length: 29 |
extended |
length: 24 |
length: 33 |
Use ascii_bin collation on MySQL/MariaDB. See core docs.
Components
HybridIdType
DBAL type that maps hybrid_id columns to PHP strings. Handles NULL values transparently.
HybridIdGenerator
ORM ID generator implementing AbstractIdGenerator. Produces HybridIds on entity persist. Supports:
- Default configuration (standard profile, auto-detected node)
- Custom core generator via constructor injection
- Per-entity prefixes via static
hybridIdPrefix()method - Global prefix via constructor parameter
Requirements
- PHP 8.3, 8.4, or 8.5
- Doctrine DBAL ^4.0
- Doctrine ORM ^3.0
- alesitom/hybrid-id ^4.1 (installed automatically)
License
MIT
All versions of hybrid-id-doctrine with dependencies
alesitom/hybrid-id Version ^4.4
doctrine/dbal Version ^4.0
doctrine/orm Version ^3.0