예제 #1
0
 public function getRegion()
 {
     if ($this->_region === null) {
         $Regions = new Default_Model_Regions();
         $Regions->filter->id->equals($this->getRegionID());
         if ($Regions->count() > 0) {
             $this->_region = $Regions->items[0];
         }
     }
     return $this->_region;
 }
예제 #2
0
 /**
  * @overrides get() from RestResource
  */
 public function get()
 {
     if (parent::get() !== false) {
         if ($this->_listMode === RestListModeEnum::RL_NORMAL) {
             $res1 = new Default_Model_Countries();
             $res2 = new Default_Model_Regions();
             $res3 = new Default_Model_NGIs();
             $res1->refresh("xml");
             $res2->refresh("xml");
             $res3->refresh("xml");
             $items = array_merge(array_merge($res1->items, $res2->items), $res3->items);
             $this->_total = count($items);
             return new XMLFragmentRestResponse($items, $this);
         } elseif ($this->_listMode === RestListModeEnum::RL_LISTING) {
             $this->_listMode = RestListModeEnum::RL_NORMAL;
             return $this->_list();
         }
     } else {
         return false;
     }
 }