- Added StaffController for managing clinic staff, including listing, creating, updating, and toggling staff status. - Created ClinicStaff entity and repository for staff data handling. - Developed SubscriptionController to manage subscription plans and periods, including trial subscriptions. - Introduced SubscriptionPlan, SubscriptionPeriod, and ClinicSubscription entities for subscription management. - Implemented SubscriptionService for handling subscription logic, including trial activation and subscription creation from payments. - Added necessary repositories for subscription entities to facilitate data access and manipulation.
44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\ClinicService\Repository;
|
|
|
|
use App\ClinicService\Entity\ServiceItem;
|
|
use App\ClinicService\Entity\ServiceSection;
|
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
|
use Doctrine\Persistence\ManagerRegistry;
|
|
|
|
class ServiceItemRepository extends ServiceEntityRepository
|
|
{
|
|
public function __construct(ManagerRegistry $registry)
|
|
{
|
|
parent::__construct($registry, ServiceItem::class);
|
|
}
|
|
|
|
public function findByUuid(string $uuid): ?ServiceItem
|
|
{
|
|
return $this->findOneBy(['uuid' => $uuid]);
|
|
}
|
|
|
|
public function findBySection(ServiceSection $section): array
|
|
{
|
|
return $this->createQueryBuilder('i')
|
|
->where('i.section = :section')
|
|
->setParameter('section', $section)
|
|
->orderBy('i.name', 'ASC')
|
|
->getQuery()
|
|
->getResult();
|
|
}
|
|
|
|
public function save(ServiceItem $item): void
|
|
{
|
|
$this->getEntityManager()->persist($item);
|
|
$this->getEntityManager()->flush();
|
|
}
|
|
|
|
public function remove(ServiceItem $item): void
|
|
{
|
|
$this->getEntityManager()->remove($item);
|
|
$this->getEntityManager()->flush();
|
|
}
|
|
}
|