Example #1
0
 /**
  * Remove a file
  *
  * @param \thebuggenie\core\entities\File $file The file to be removed
  *
  * @return boolean
  */
 public function detachFile(File $file)
 {
     tables\ArticleFiles::getTable()->removeByArticleIDandFileID($this->getID(), $file->getID());
     if (is_array($this->_files) && array_key_exists($file->getID(), $this->_files)) {
         unset($this->_files[$file->getID()]);
     }
     $file->delete();
 }