예제 #1
0
 public function populate($data)
 {
     if (is_null($this->_busunit)) {
         $this->_busunit = new Busunit_Model_Busunit();
     }
     Agana_Data_BeanUtil::populate($this->_busunit, $data);
     if (isset($data['id'])) {
         $this->_busunit->setId($data['id']);
     }
     if (isset($data['city_id'])) {
         $dc = new Location_Domain_City();
         $c = $dc->getById($data['city_id']);
         $this->_busunit->setCity($c);
     }
 }
예제 #2
0
 public function populate($data)
 {
     if (isset($data['id'])) {
         $this->_region->setId($data['id']);
     }
     $this->_region->setName($data['name']);
     if (isset($data['city_id'])) {
         $dc = new Location_Domain_City();
         $c = $dc->getById($data['city_id']);
         $this->_region->setCity($c);
         $this->_region->setCity_id($data['city_id']);
     }
     if (isset($data['parent_id'])) {
         if (is_numeric($data['parent_id'])) {
             $dc = new Location_Domain_CityRegion();
             $c = $dc->getById($data['parent_id']);
             $this->_region->setParent($c);
             $this->_region->setParent_id($data['parent_id']);
         }
     }
 }
예제 #3
0
 public function getBornCity()
 {
     if (!$this->bornCity) {
         $domain = new Location_Domain_City();
         $this->bornCity = $domain->getById($this->born_city_id);
     }
     return $this->bornCity;
 }
예제 #4
0
 public function getCity()
 {
     if (is_null($this->city_id) || !is_numeric($this->city_id)) {
         $this->city = new Location_Model_City();
     } else {
         if (is_null($this->city)) {
             $domain = new Location_Domain_City();
             $this->city = $domain->getById($this->city_id);
         }
     }
     return $this->city;
 }