Install with composer
composer req phpguild/doctrine-extra-bundle
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;
}
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;
}
doctrine:
orm:
filters:
soft_deletable:
class: PhpGuild\DoctrineExtraBundle\Doctrine\Filter\SoftDeletableFilter
enabled: true
View documentation https://github.com/KnpLabs/DoctrineBehaviors