/** * @param Restaurant $restaurant * * @return Restaurant|null */ public function getRestaurantByRestaurant(Restaurant $restaurant) { $results = $this->getEntityManager()->createQueryBuilder()->select('r')->from(Restaurant::SHORTCUT_CLASS_NAME, 'r')->where('r.name = :name')->andWhere('r.lat = :lat')->andWhere('r.lng = :lng')->setParameter('name', $restaurant->getName())->setParameter('lat', $restaurant->getLat())->setParameter('lng', $restaurant->getLng())->getQuery()->getResult(); if (count($results) > 0) { return $results[0]; } return null; }
/** * @return array */ public function getMeta() { return array('coordinate' => array($this->restaurant->getLng(), $this->restaurant->getLat())); }