Based on DoctrineORM and Symfony.
- php >= 7.3
- Symfony >= 4.2
Use the package manager composer to install.
composer require vaderlab/eav-core-bundle
Create database schema
$ php bin/console doctrine:schema:update --force
Create new schema class
<?php
use Vaderlab\EAV\Core\Annotation as EAV;
class User
{
/**
* @EAV\Id(target="id"),
*/
private $id;
/**
* @EAV\Attribute( name="username", type="string", length=256, unique=true)
*/
private $username;
/**
* @EAV\Attribute( name="created_at", type="datetime")
*/
private $createdAt;
/**
* @EAV\Attribute( name="is_enabled", type="boolean")
*/
private $enabled;
/* getters and setters */
/* ....... */
}
Create (syncronize) EAV schema with protected attributes
$ php bin/console vaderlab:eav:schema-update -f
Create Entity
$em = $this->get('doctrine.orm.entity_manager');
$user = new User();
$user->setUsername('Asisyas');
$user->setEnabled(true);
$em->persist($user);
$em->flush();
Find entity by Id
$em = $this->get('doctrine.orm.entity_manager');
$user = $em->find(User::class, 1);
$user->setUsername('Vaderlab');
$em->persist($user);
$em->flush();
- Indexer and QueryBundler
- Reactive Forms
- Protected properties (If property contains in the entity class, user can not update this property from admin)
- Simple admin interface
- REST interface
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.