You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
876 B
37 lines
876 B
<?php
|
|
|
|
namespace Entity\Repository;
|
|
|
|
use Doctrine\Common\Collections\Criteria;
|
|
use Gedmo\Tree\Entity\Repository\NestedTreeRepository;
|
|
|
|
/**
|
|
* Class BranchSyncRepository
|
|
* @package Entity\Repository
|
|
*/
|
|
class BranchSyncRepository extends NestedTreeRepository
|
|
{
|
|
/**
|
|
* @param string $keyword
|
|
* @return mixed
|
|
*/
|
|
public function searchByKeyword($keyword)
|
|
{
|
|
$qb = $this->createQueryBuilder('a');
|
|
|
|
//Selecting user info
|
|
$qb->select('DISTINCT b');
|
|
|
|
$qb->from('Entity\BranchSync', 'b');
|
|
|
|
//Selecting courses for users
|
|
//$qb->innerJoin('u.courses', 'c');
|
|
|
|
//@todo check app settings
|
|
$qb->add('orderBy', 'b.branchName ASC');
|
|
$qb->where('b.branchName LIKE :keyword');
|
|
$qb->setParameter('keyword', "%$keyword%");
|
|
$q = $qb->getQuery();
|
|
return $q->execute();
|
|
}
|
|
}
|
|
|