add projects
This commit is contained in:
parent
cf5c37975e
commit
1717ce5c2c
13 changed files with 610 additions and 2 deletions
29
src/Repository/ProjectRepositoryQuery.php
Normal file
29
src/Repository/ProjectRepositoryQuery.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\ProjectRepository as Repository;
|
||||
use App\Entity\Project;
|
||||
|
||||
class ProjectRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
public function __construct(Repository $repository, PaginatorInterface $paginator)
|
||||
{
|
||||
parent::__construct($repository, 'p', $paginator);
|
||||
}
|
||||
|
||||
public function published()
|
||||
{
|
||||
return $this
|
||||
->andWhere('.status = :published')
|
||||
->setParameter(':published', Project::PUBLISHED)
|
||||
;
|
||||
}
|
||||
|
||||
public function ordered()
|
||||
{
|
||||
return $this->orderBy('.sortOrder');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue