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; }