コード例 #1
0
 /**
  * @param array $data
  *
  * @return FullPlaceResult
  */
 public function createDetail($data)
 {
     $place = new FullPlaceResult();
     $place->setId($data['place_id']);
     $place->setName($data['name']);
     $place->setIcon($data['icon']);
     $place->setLatitude($data['geometry']['location']['lat']);
     $place->setLongitude($data['geometry']['location']['lng']);
     if (isset($data['website'])) {
         $place->setWebsite($data['website']);
     }
     if (isset($data['international_phone_number'])) {
         $place->setTelephone($data['international_phone_number']);
     }
     $this->setAddress($place, $data['address_components']);
     if (isset($data['photos'])) {
         $this->setPhotos($place, $data['photos']);
         $this->setPicture($place, $data['photos']);
     }
     return $place;
 }