protected function getImageSet() { if (!$this->image_set instanceof SiteImageSet) { if ($this->getObject()->image instanceof SiteImage) { $this->image_set = $this->getObject()->image->image_set; } else { $class_name = SwatDBClassMap::get('SiteImageSet'); $this->image_set = new $class_name(); $this->image_set->setDatabase($this->app->db); $shortname = $this->getImageSetShortname(); if (!$this->image_set->loadByShortname($shortname)) { throw new AdminNotFoundException(sprintf('Image set with shortname “%s” not found.', $shortname)); } } } return $this->image_set; }
protected function init() { parent::init(); $this->registerInternalProperty('instance', SwatDBClassMap::get('SiteInstance')); }