/** * {@inheritdoc} */ public function destroy() { // Catch `queue not found` exceptions, throw the rest. try { $this->repisotory->createQueryBuilder('o')->select(null)->delete('o')->where('o.name = :name')->setParameter('name', $this->getNameWithPrefix()); } catch (\Exception $e) { if (false !== strpos($e->getMessage(), "Queue not found")) { $this->log(400, "Queue did not exist"); } else { throw $e; } } $key = $this->getNameWithPrefix(); $this->cache->delete($key); $this->log(200, "Queue has been destroyed."); return true; }
/** * @param $transactionId * * @return null|RecordInterface */ public function findTransactionId($transactionId) { return $this->repository->findOneBy(array('transactionId' => $transactionId)); }
/** * @param string $keyword * @param int $limit * * @return TagInterface[]|null */ public function search($keyword, $limit = 10) { return $this->createQueryBuilder('o')->where(parent::expr()->like('LOWER(o.name)', ':keyword'))->setParameter('keyword', '%' . $keyword . '%')->setMaxResults($limit)->getQuery()->getResult(); }