|
@@ -3,6 +3,7 @@ declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App\Repository\Organization;
|
|
namespace App\Repository\Organization;
|
|
|
|
|
|
|
|
|
|
+use App\Entity\Organization\Organization;
|
|
|
use App\Entity\Organization\OrganizationAddressPostal;
|
|
use App\Entity\Organization\OrganizationAddressPostal;
|
|
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
|
|
use Doctrine\Persistence\ManagerRegistry;
|
|
use Doctrine\Persistence\ManagerRegistry;
|
|
@@ -19,4 +20,21 @@ class OrganizationAddressPostalRepository extends ServiceEntityRepository
|
|
|
{
|
|
{
|
|
|
parent::__construct($registry, OrganizationAddressPostal::class);
|
|
parent::__construct($registry, OrganizationAddressPostal::class);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Récupération des adresses postal d'une organization et d'un type précis
|
|
|
|
|
+ * @param String $type
|
|
|
|
|
+ * @param Organization $organization
|
|
|
|
|
+ * @return array|null
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getByType(String $type, Organization $organization): array | null{
|
|
|
|
|
+ return $this->createQueryBuilder('organizationAddressPostal')
|
|
|
|
|
+ ->where('organizationAddressPostal.type = :type')
|
|
|
|
|
+ ->andWhere('organizationAddressPostal.organization = :organization')
|
|
|
|
|
+ ->setParameter('type', $type)
|
|
|
|
|
+ ->setParameter('organization', $organization)
|
|
|
|
|
+ ->getQuery()
|
|
|
|
|
+ ->getResult()
|
|
|
|
|
+ ;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|