/** * @param Restaurant $restaurant */ protected function hydratePictureAndThumb(Restaurant $restaurant) { if ($restaurant->getPicture()) { $restaurant->setPicture($this->cloudfrontUrl . $restaurant->getPicture()); } else { $restaurant->setPicture($this->cloudfrontUrl . 'restaurant/_default_restaurant_cover.png'); } if ($restaurant->getThumb()) { $restaurant->setThumb($this->cloudfrontUrl . $restaurant->getThumb()); } else { $restaurant->setThumb($this->cloudfrontUrl . 'restaurant_thumb/_default_restaurant.png'); } }
public function create() { $geoname = $this->getRandomGeoname(); $restaurant = new Restaurant(); $restaurant->setWebsite('http://www.google.com'); $restaurant->setAddress($this->getRandomAddress()); $restaurant->setLat($this->getRandomLat($geoname)); $restaurant->setLng($this->getRandomLng($geoname)); $restaurant->setAverageCost(rand(0, 200)); $restaurant->setName($this->getRandomName()); $restaurant->setCuisine($this->getRandomCuisine()); $restaurant->setGeoname($geoname); $restaurant->setPhone('04422556677'); $restaurant->setPicture(null); $restaurant->setThumb(null); return $restaurant; }