|
|
@ -40,31 +40,6 @@ class UserRepository extends EntityRepository implements UserProviderInterface |
|
|
|
return $q->execute(); |
|
|
|
return $q->execute(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @param string $keyword |
|
|
|
|
|
|
|
* @return mixed |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public function searchUserByKeyword($keyword) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$qb = $this->createQueryBuilder('a'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Selecting user info |
|
|
|
|
|
|
|
$qb->select('DISTINCT b'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$qb->from('Entity\User', 'b'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Selecting courses for users |
|
|
|
|
|
|
|
//$qb->innerJoin('u.courses', 'c'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//@todo check app settings |
|
|
|
|
|
|
|
$qb->add('orderBy', 'b.firstname ASC'); |
|
|
|
|
|
|
|
$qb->where('b.firstname LIKE :keyword OR b.lastname LIKE :keyword '); |
|
|
|
|
|
|
|
$qb->setParameter('keyword', "%$keyword%"); |
|
|
|
|
|
|
|
$q = $qb->getQuery(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $q->execute(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @param string $username |
|
|
|
* @param string $username |
|
|
|
* @return mixed |
|
|
|
* @return mixed |
|
|
|