protected function saveDBData() { $author_id = $this->ui->getWidget('author')->value; if ($this->comment->id === null) { $this->comment->author = $author_id; // update user's default author to selected author when creating a // new comment $this->updateDefaultAuthor($author_id); } else { if ($this->comment->getInternalValue('author') !== null) { $class_name = SwatDBClassMap::get('BlorgAuthor'); $author = new $class_name(); $author->setDatabase($this->app->db); if ($author->load($author_id, $this->app->getInstance())) { $this->comment->author = $author; } } } parent::saveDBData(); }
protected function saveDBData() { $photographer_id = $this->ui->getWidget('photographer')->value; if (count($this->photographers) > 0) { $class_name = SwatDBClassMap::get('PinholePhotographer'); $photographer = new $class_name(); $photographer->setDatabase($this->app->db); if ($photographer->load($photographer_id, $this->app->getInstance())) { $this->comment->photographer = $photographer; } } parent::saveDBData(); }