'saveGallery', ActiveRecord::EVENT_BEFORE_UPDATE => 'saveGallery', ]; } /** * Save seo model */ public function saveGallery() { $model = $this->owner; if (isset($model->{$this->galleryRow})) { $galleryManager = $this->getGalleryManager(); $model->{$this->galleryRow} = $galleryManager->getOptionsForSaving($model->{$this->galleryRow}, $this->path); if (! $model->isScenario($this->scenario)) { throw new Exception(get_class($model) . '::' . $this->scenario . " scenario doesn't exist"); } } } /** * Gallery manager * @return null */ private function getGalleryManager() { if ($this->_galleryManagerModel === null) { $this->_galleryManagerModel = new $this->_galleryManagerNamespace(); } return $this->_galleryManagerModel; } }