deprecated: fix PersonRepository location

This commit is contained in:
2020-07-15 16:00:59 +02:00
parent 7060fc2e6a
commit e886d671c1
2 changed files with 35 additions and 37 deletions

View File

@@ -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) {