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

v1.2.4 2022-02-10 17:15 UTC

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