remove() public method

Remove image
public remove ( string $filename ) : boolean
$filename string Filename
return boolean
Example #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testRemove()
 {
     $this->assertTrue($this->object->remove('undefined-file'));
 }
Example #2
0
 /**
  * Delete file
  *
  * @return \Zend\View\Model\JsonModel
  */
 public function removeAction()
 {
     $property = Property\Model::fromId($this->getRouteMatch()->getParam('property_id'));
     $document = Document\Model::fromId($this->getRouteMatch()->getParam('document_id'));
     if ($this->getRequest()->getMethod() != 'DELETE' or empty($document) or empty($property)) {
         return $this->returnJson(array('error' => true));
     }
     $file = base64_decode($this->getRouteMatch()->getParam('file'));
     $fileClass = new File();
     $fileClass->load($property, $document);
     return $this->returnJson(array($fileClass->remove($file)));
 }