Gc\Document\Model::getIcon PHP Method

getIcon() public method

(non-PHPdoc)
See also: include Gc\Component\IterableInterface#getIcon()
public getIcon ( ) : mixed
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');
    }

Usage Example

コード例 #1
0
ファイル: ModelTest.php プロジェクト: gotcms/gotcms
 /**
  * Test
  *
  * @return void
  */
 public function testGetEmptyIcon()
 {
     $this->object->getDocumentType()->setIconId(42000);
     $this->assertFalse($this->object->getIcon());
 }