コード例 #1
0
 public function getActiveChains()
 {
     if (($netpath_idx = $this->getIdx()) === false) {
         static::raiseError(__CLASS__ . '::getIdx() returned false!');
         return false;
     }
     try {
         $chains = new \MasterShaper\Models\ChainsModel(array('netpath_idx' => $netpath_idx));
     } catch (\Exception $e) {
         static::raiseError(__METHOD__ . '(), failed to load ChainsModel!', false, $e);
         return false;
     }
     if (!$chains->hasItems()) {
         return array();
     }
     if (($items = $chains->getItems()) === false) {
         static::raiseError(get_class($chains) . '::getItems() returned false!');
         return false;
     }
     return $items;
 }
コード例 #2
0
 public function showEdit($id, $guid)
 {
     global $tmpl;
     try {
         $item = new \MasterShaper\Models\NetworkPathModel(array('idx' => $id, 'guid' => $guid));
     } catch (\Exception $e) {
         static::raiseError(__METHOD__ . '(), failed to load NetworkPathModel!', false, $e);
         return false;
     }
     try {
         $chains = new \MasterShaper\Models\ChainsModel(array('host_idx' => $id));
     } catch (\Exception $e) {
         static::raiseError(__METHOD__ . '(), failed to load ChainsModel!', false, $e);
         return false;
     }
     if (($this->chains = $chains->getItems()) === false) {
         static::raiseError(get_class($chains) . '::getItems() returned false!');
         return false;
     }
     $tmpl->assign('netpath', $item);
     return parent::showEdit($id, $guid);
 }