atournayre/doctrine-component

This component add some features to help Doctrine entities management.

0.0.0 2023-12-02 09:51 UTC

This package is auto-updated.

Last update: 2024-10-31 00:28:57 UTC


README

This component add some features to help Doctrine entities management.

Installation

composer require atournayre/doctrine-component

Usage

namespace App\Repository;

use Atournayre\Component\Doctrine\Traits\SaveAndRemoveTrait;use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Atournayre\Component\Doctrine\Traits\SaveTrait;
use Atournayre\Component\Doctrine\Traits\RemoveTrait;

class TestRepository extends ServiceEntityRepository
{
    // To persist entities
    use SaveTrait;
    // To remove entities
    use RemoveTrait;
    // To persist and remove entities
    use SaveAndRemoveTrait;
}
namespace App\Entity;

use Atournayre\Component\Doctrine\Contracts\IsEntityInterface;

class Test implements IsEntityInterface
{
}

Contribution

Contributions are welcome!