2 namespace Auction\Service;
7 * Manage open saturdays.
10 class OpenDay extends \Auction\DataBin\OpenDay
15 * @param object|null $jobRecord
16 * @param \Workspace\Utility\ServiceInputParams $contract
19 public function canDelete(array $meta, $jobRecord, $contract, array $data)
21 $items = $this->em->createQuery(
22 "SELECT auction FROM \\Auction\\Entity\\Auction auction "
23 . "WHERE auction.endDate LIKE :endDate AND auction.jobState = :status"
25 ->setParameter('endDate', $jobRecord->openDate->format('Y-m-d') . '%')
26 ->setParameter('status', 'Active')
28 if (0 < count($items))
30 throw new \Exception('There are auctions ending on this date, please remove auction items before deleting.');