コード例 #1
0
ファイル: Map.php プロジェクト: HaldunA/phpwebsite
 public static function getGoogleSearchString(\contact\Resource\ContactInfo\PhysicalAddress $physical_address)
 {
     $building = $physical_address->getBuilding();
     $street = $physical_address->getStreet();
     $city = $physical_address->getCity();
     $state = $physical_address->getState();
     if (empty($building) || empty($street) || empty($city) || empty($state)) {
         throw new \Exception('Building, street, city and state are required information.');
     } else {
         $address = "{$building},+{$street},+{$city},+{$state}";
         return $address;
     }
 }
コード例 #2
0
 public static function load()
 {
     $physical_address = new \contact\Resource\ContactInfo\PhysicalAddress();
     $physical_address->setRoomNumber(\Settings::get('contact', 'room_number'));
     $physical_address->setBuilding(\Settings::get('contact', 'building'));
     $physical_address->setStreet(\Settings::get('contact', 'street'));
     $physical_address->setPostBox(\Settings::get('contact', 'post_box'));
     $physical_address->setCity(\Settings::get('contact', 'city'));
     $physical_address->setState(\Settings::get('contact', 'state'));
     $physical_address->setZip(\Settings::get('contact', 'zip'));
     return $physical_address;
 }
コード例 #3
0
 public static function getValues(PhysicalAddressResource $physical_address)
 {
     $values['room_number'] = $physical_address->getRoomNumber();
     $values['building'] = $physical_address->getBuilding();
     $values['street'] = $physical_address->getStreet();
     $values['post_box'] = $physical_address->getPostBox();
     $values['city'] = $physical_address->getCity();
     $values['state'] = $physical_address->getState();
     $values['zip'] = $physical_address->getZip();
     return $values;
 }