/** * Get views * * @param boolean $forceReload to initiliaze views * * @return array */ public function getIcons($forceReload = false) { if ($forceReload) { $rows = $this->fetchAll($this->select(function (Select $select) { $select->order('name'); })); $array = array(); foreach ($rows as $row) { $array[] = Model::fromId($row['id']); } $this->setData('icons', $array); } return $this->getData('icons'); }
/** * Test * * @return void */ public function testFromWithWrongId() { $this->assertFalse(Model::fromId('undefined')); }
/** (non-PHPdoc) * * @see include \Gc\Component\IterableInterface#getIcon() * @return mixed */ public function getIcon() { if ($this->getData('icon') === null) { $icon = Icon\Model::fromId($this->getDocumentType()->getIconId()); if (empty($icon)) { return false; } $this->setData('icon', $icon->getUrl()); } return $this->getData('icon'); }