*/ class DoctrineClientRepository extends ServiceEntityRepository implements ClientRepositoryInterface { public function __construct(ManagerRegistry $registry) { parent::__construct($registry, Client::class); } public function findById(int $id): ?Client { return $this->find($id); } public function save(Client $client): void { $this->getEntityManager()->persist($client); $this->getEntityManager()->flush(); } public function createListQueryBuilder(bool $includeArchived = false): QueryBuilder { $qb = $this->createQueryBuilder('c') ->andWhere('c.deletedAt IS NULL') ->orderBy('c.companyName', 'ASC') ; if (!$includeArchived) { $qb->andWhere('c.isArchived = false'); } return $qb; } }