Example #1
0
File: File.php Project: nexcra/cb5
 /**
  * Remove file.
  *
  * @access public
  * @param  \CB\Entity\File $File
  * @return void
  */
 public function remove($File)
 {
     $Location = $File->getLocation();
     $this->_slug = $Location->getSlug();
     $this->_created = $Location->getCreated();
     $this->_deleteFiles($File->getFileName(), $File->getExtension());
     $this->_deleteDirIfEmpty($this->_getFileDir());
     foreach ($File->getLayers() as $Layer) {
         $this->getEntityManager()->remove($Layer);
     }
     $this->getEntityManager()->remove($File);
 }