<?php
foreach (array_keys($values['services']) as $serviceId) {
$service = $this->_em->find('\cut\Entity\Service', $serviceId);
//\Doctrine\Common\Util\Debug::print_r($service); exit();
//$reservation->addService($this->_em->find('\cut\Entity\Service', $serviceId));
$this->view->serviceDeposits[$serviceId] = $service->getDeposit();
}
# checkign if clinic want's bill
$notifications = array();
$reservationServices = array();
foreach (array_keys($values['services']) as $serviceId) {
$reservationServices[$serviceId] = new \cut\Entity\ReservationService();
$service = $this->_em->find('\cut\Entity\Service', $serviceId);
//\Doctrine\Common\Util\Debug::print_r($service); exit();
$reservationServices[$serviceId]->setService($service);
$reservationServices[$serviceId]->setReservation($reservation);
$reservationServices[$serviceId]->setPatient($this->_helper->LoggedUser());
switch ($service->getDeposit()) {
case 'yes':
$reservationServices[$serviceId]->setBillStatus(\cut\Entity\ReservationService::BILL_STATUS_NOT_PAID);
break;
default:
$reservationServices[$serviceId]->setBillStatus(\cut\Entity\ReservationService::BILL_STATUS_NOT_WANTED);
}
$this->view->serviceDeposits[$serviceId] = $service->getDeposit();
}