mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 21:13:57 +00:00
deprecated: fix PersonRepository location
This commit is contained in:
@@ -18,15 +18,25 @@
|
||||
|
||||
namespace Chill\PersonBundle\Repository;
|
||||
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
|
||||
/**
|
||||
* PersonRepository
|
||||
* Class PersonRepository
|
||||
*
|
||||
* @package Chill\PersonBundle\Repository
|
||||
*/
|
||||
class PersonRepository extends \Chill\PersonBundle\Entity\PersonRepository
|
||||
class PersonRepository extends EntityRepository
|
||||
{
|
||||
/**
|
||||
* @param string $phonenumber
|
||||
* @param $centers
|
||||
* @param $firstResult
|
||||
* @param $maxResults
|
||||
* @param array $only
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function findByPhone(
|
||||
string $phonenumber,
|
||||
$centers,
|
||||
@@ -47,6 +57,14 @@ class PersonRepository extends \Chill\PersonBundle\Entity\PersonRepository
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $phonenumber
|
||||
* @param $centers
|
||||
* @param array $only
|
||||
* @return int
|
||||
* @throws \Doctrine\ORM\NoResultException
|
||||
* @throws \Doctrine\ORM\NonUniqueResultException
|
||||
*/
|
||||
public function countByPhone(
|
||||
string $phonenumber,
|
||||
$centers,
|
||||
@@ -62,6 +80,12 @@ class PersonRepository extends \Chill\PersonBundle\Entity\PersonRepository
|
||||
return $qb->getQuery()->getSingleScalarResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param QueryBuilder $qb
|
||||
* @param string $phonenumber
|
||||
* @param array $only
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function addPhoneNumber(QueryBuilder $qb, string $phonenumber, array $only)
|
||||
{
|
||||
if (count($only) === 0) {
|
||||
@@ -84,12 +108,19 @@ class PersonRepository extends \Chill\PersonBundle\Entity\PersonRepository
|
||||
$qb->setParameter('phonenumber', '%'.$phonenumber.'%');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $phonenumber
|
||||
* @return string
|
||||
*/
|
||||
protected function parsePhoneNumber($phonenumber): string
|
||||
{
|
||||
return \str_replace(' ', '', $phonenumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param QueryBuilder $qb
|
||||
* @param array $centers
|
||||
*/
|
||||
protected function addByCenters(QueryBuilder $qb, array $centers)
|
||||
{
|
||||
if (count($centers) > 0) {
|
||||
|
Reference in New Issue
Block a user