PHP code example of atournayre / doctrine-component
1. Go to this page and download the library: Download atournayre/doctrine-component library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
atournayre / doctrine-component example snippets
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
{
}