示例#1
0
 public static function as_list()
 {
     if (is_null(self::$_as_list)) {
         $table = self::getInstance()->table();
         $sql = sprintf('SELECT %s, name FROM %s order by name', $table->idFIeld(), $table->tableName());
         $list = $table->getAdapter()->fetchPairs($sql);
         self::$_as_list = $list;
     }
     return self::$_as_list;
 }
示例#2
0
 /**
  *
  * @return void
  */
 public function load_countries()
 {
     $this->country->setMultiOptions(Zupal_Places_Countries::as_list());
 }
示例#3
0
 public function set_country($pValue)
 {
     $country = Zupal_Places_Countries::getInstance()->get_country($pValue);
     if ($country) {
         $this->country = $country->identity();
     } else {
         $this->country = 0;
     }
 }
示例#4
0
 public function setCountry($pValue)
 {
     if ($pValue instanceof Zend_Places_Countries) {
         $this->country_id = $pValue->identity();
         $this->country = $pValue->get_value();
     } else {
         $country = Zupal_Places_Countries::getInstance()->get_country($pValue);
         if ($country) {
             $this->country_id = $country->identity();
             $this->country = $country->get_value();
         } else {
             $this->country_id = '';
             $this->country = '';
             //@TODO: throw error?
         }
     }
 }