Skip to content

phpguild/doctrine-extra-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Doctrine Extra Bundle

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