Download the PHP package ufo-tech/doctrine-eav-bundle without Composer
On this page you can find all versions of the php package ufo-tech/doctrine-eav-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ufo-tech/doctrine-eav-bundle
More information about ufo-tech/doctrine-eav-bundle
Files in ufo-tech/doctrine-eav-bundle
Package doctrine-eav-bundle
Short Description The DoctrineEAVBundle provides a seamless integration of the Entity-Attribute-Value (EAV) model with Doctrine ORM within the Symfony framework
License MIT
Homepage https://github.com/ufo-tech/doctrine-eav-bundle
Informations about the package doctrine-eav-bundle
DoctrineEAVBundle
Українська
DoctrineEAVBundle integrates the Entity-Attribute-Value (EAV) model with Doctrine ORM in Symfony applications. It is meant for data whose set of attributes is not fixed in advance — product characteristics in e-commerce, configurable catalogs, and similar dynamic data.
Features
- Dynamic attributes: attach any number of parameters to an entity without changing the database schema.
- Typed values: string, number, boolean, option list and file values are stored in one table (Doctrine single-table inheritance); the type is chosen from the PHP value.
- Specifications (variants): an entity has a tree of specifications; a child specification inherits its parent's values and overrides only what differs.
- Localization: values and options can be stored per locale with fallback to the default locale; categories are translatable.
- Filtering and search: ready-made services for faceted filtering (available parameters, values and counts) and search over specification names and values, backed by SQL views.
- Categories: tree-structured, translatable categories with their own filter sets.
Requirements
- PHP 8.3+
- Symfony 7
- Doctrine ORM, DoctrineBundle, DoctrineMigrationsBundle
- MySQL — the SQL views use recursive CTEs, window functions and JSON functions (MySQL 8.0+). Other databases are not supported.
Installation
If the Symfony Flex recipe was not applied, register the bundle manually in config/bundles.php:
The bundle configures Doctrine by itself: it registers the mapping of its entities, the enum DBAL type, and the DQL functions it needs (JSON_*, POWER, COUNT_SLASHES). No extra configuration is required.
Setup
1. Create your entities
EavEntity and EavCategory are mapped superclasses — extend them in your application:
Relations from the bundle's tables are redirected to your table automatically during schema generation.
2. Generate and run migrations
The read side relies on three SQL views (eav_spec_details_view, eav_spec_details_json_view, eav_common_params_filter_view). On the first schema generation, if the views do not exist yet, the bundle generates a separate migration that creates them. It can also be generated manually:
Usage
Writing values
Reading: $spec->getValue('color') or $spec->getValue('color', 'uk') (falls back to the default-locale value).
Filtering
Search
License
MIT — see LICENSE.
All versions of doctrine-eav-bundle with dependencies
symfony/framework-bundle Version ^7
symfony/console Version ^7
symfony/http-kernel Version ^7
doctrine/doctrine-bundle Version >=2.8
doctrine/doctrine-migrations-bundle Version >=3.2
doctrine/orm Version >=2.0
scienta/doctrine-json-functions Version ^6.1
ufo-tech/doctrine-helper Version *
ufo-tech/doctrine-behaviors Version ^1