Example #1
0
 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;
 }
Example #2
0
 protected function init()
 {
     parent::init();
     $this->registerInternalProperty('instance', SwatDBClassMap::get('SiteInstance'));
 }