コード例 #1
0
ファイル: question.php プロジェクト: sumudinie/hubzero-cms
 /**
  * Delete the record and all associated data
  *
  * @return  boolean  False if error, True on success
  */
 public function delete()
 {
     // Can't delete what doesn't exist
     if (!$this->exists()) {
         return true;
     }
     // Adjust credits
     $this->adjustCredits();
     // Remove comments
     foreach ($this->comments('list', array('filterby' => 'all')) as $comment) {
         if (!$comment->delete()) {
             $this->setError($comment->getError());
             return false;
         }
     }
     // Remove all tags
     $this->tag('');
     // Attempt to delete the record
     return parent::delete();
 }
コード例 #2
0
ファイル: response.php プロジェクト: sumudinie/hubzero-cms
 /**
  * Delete the record and all associated data
  *
  * @return  boolean False if error, True on success
  */
 public function delete()
 {
     // Can't delete what doesn't exist
     if (!$this->exists()) {
         return true;
     }
     // Remove comments
     foreach ($this->replies('list') as $comment) {
         if (!$comment->delete()) {
             $this->setError($comment->getError());
             return false;
         }
     }
     // Clear the history of "helpful" clicks
     $al = new Tables\Log($this->_db);
     if (!$al->deleteLog($this->get('id'))) {
         $this->setError($al->getError());
         return false;
     }
     return parent::delete();
 }
コード例 #3
0
ファイル: comment.php プロジェクト: sumudinie/hubzero-cms
 /**
  * Delete the record and all associated data
  *
  * @return  boolean  False if error, True on success
  */
 public function delete()
 {
     // Can't delete what doesn't exist
     if (!$this->exists()) {
         return true;
     }
     // Remove comments
     foreach ($this->replies('list') as $comment) {
         if (!$comment->delete()) {
             $this->setError($comment->getError());
             return false;
         }
     }
     return parent::delete();
 }