PHP code example of juliangut / doctrine-base-repositories
1. Go to this page and download the library: Download juliangut/doctrine-base-repositories 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/ */
juliangut / doctrine-base-repositories example snippets
use Doctrine\ORM\EntityRepository;
use Jgut\Doctrine\Repository\EventsTrait;
use Jgut\Doctrine\Repository\FiltersTrait;
use Jgut\Doctrine\Repository\PaginatorTrait;
use Jgut\Doctrine\Repository\Repository;
use Jgut\Doctrine\Repository\RepositoryTrait;
class customRepository extends EntityRepository implements Repository
{
use RepositoryTrait;
use EventsTrait;
use FiltersTrait;
use PaginatorTrait;
protected function getFilterCollection()
{
// Custom implementation
}
public function countBy($criteria)
{
// Custom implementation
}
public function findPaginatedBy($criteria, array $orderBy = [], $itemsPerPage = 10)
{
// Custom implementation
}
protected function getManager()
{
// Custom implementation
}
// Custom methods
}