https://github.com/micro-php/plugin-eav-core
Entity Attribute Value model supports
https://github.com/micro-php/plugin-eav-core
Last synced: 3 months ago
JSON representation
Entity Attribute Value model supports
- Host: GitHub
- URL: https://github.com/micro-php/plugin-eav-core
- Owner: Micro-PHP
- License: mit
- Created: 2022-02-09T09:29:48.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-09T09:30:15.000Z (over 3 years ago)
- Last Synced: 2025-01-12T14:48:24.745Z (4 months ago)
- Language: PHP
- Size: 47.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Micro Framework Doctrine Component (WIP)
Micro Framework plugin. Entity Attribute Value (EAV) supports.
## Installation
Use the package manager [Composer](https://getcomposer.org/) to install.
```bash
composer require micro/plugin-eav-core
```## Basic Configure
#### 1. Use one of available adapters
1. micro/plugin-eav-doctrine
## Basic Usage#### Programmatically create EAV Schema with attributes
```php
use Micro\Plugin\Eav\EavFacadeInterface;
/** @var EavFacadeInterface $eavFacade */
$eavFacade = $container->get(EavFacadeInterface::class);
$eavSchemaFacade = $eavFacade->schema();
$schema = $eavSchemaFacade
->createBuilder()
->setName('Book')
->addAttribute('title')
->setLength(100)
->setIsUnique(true)
->setDescription('Book title')
->setType('string')
->setIsNullable(true)
->complete()
->addAttribute('author')
->complete()
->force()
->build();$eavFacade->schema()->save($eavSchemaFacade);
```
## Other docs
* ### [Examples](docs/Examples.md)
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.
## License
[MIT](LICENSE)