phpguild / doctrine-extra-bundle
Doctrine Extra Bundle
Installs: 2 545
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 2
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=7.2
- beberlei/doctrineextensions: ^1.3
- knplabs/doctrine-behaviors: ^2.0
- symfony/orm-pack: ^2.1
- symfony/uid: 5.3.*|6.*
README
Installation
Install with composer
composer req phpguild/doctrine-extra-bundle
Usage
Models
Entity with UUID
Auto generated UUID
use Doctrine\ORM\Mapping as ORM;
use PhpGuild\DoctrineExtraBundle\Model\Uuid\UuidInterface;
use PhpGuild\DoctrineExtraBundle\Model\Uuid\UuidTrait;
/**
* Class User
*
* @ORM\Entity
*/
class User implements UuidInterface
{
use UuidTrait;
}
Entity with Identity
Auto increment numeric ID
use Doctrine\ORM\Mapping as ORM;
use PhpGuild\DoctrineExtraBundle\Model\Identity\IdentityInterface;
use PhpGuild\DoctrineExtraBundle\Model\Identity\IdentityTrait;
/**
* Class User
*
* @ORM\Entity
*/
class User implements IdentityInterface
{
use IdentityTrait;
}
Filters
SofDeletable
doctrine:
orm:
filters:
soft_deletable:
class: PhpGuild\DoctrineExtraBundle\Doctrine\Filter\SoftDeletableFilter
enabled: true
Doctrine Behaviors
View documentation https://github.com/KnpLabs/DoctrineBehaviors