コード例 #1
0
ファイル: State.php プロジェクト: brunopbaffonso/ongonline
 private function _addElementCountry()
 {
     $this->addElement('select', 'country_id', array('required' => true, 'label' => 'Country', 'dimension' => 4));
     $el = $this->getElement('country_id');
     $cd = new Location_Domain_Country();
     $c = $cd->getAll('name');
     foreach ($c as $country) {
         $el->addMultiOption($country->getId(), $country->getName());
     }
 }
コード例 #2
0
ファイル: State.php プロジェクト: brunopbaffonso/ongonline
 public function populate($data)
 {
     if (isset($data['id'])) {
         $this->_state->setId($data['id']);
     }
     $this->_state->setName($data['name']);
     $this->_state->setAbbreviation($data['abbreviation']);
     if (isset($data['country_id'])) {
         $dc = new Location_Domain_Country();
         $c = $dc->getById($data['country_id']);
         $this->_state->setCountry($c);
     }
 }