예제 #1
0
파일: Edit.php 프로젝트: GervaisdeM/blorg
 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();
 }
예제 #2
0
파일: Edit.php 프로젝트: gauthierm/pinhole
 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();
 }