public function remove(FileAbstraction $entity)
	{
		$eventArgs = new FileEvent();
		$eventArgs->setFile($entity);
		$this->fireFileEvent(FileEvent::FILE_EVENT_PRE_DELETE, $eventArgs);

		if ($entity instanceof Folder) {
			$hasChildren = $entity->hasChildren();
			if ($hasChildren) {
				throw new Exception\NotEmptyException('You can remove only empty folders');
			}
			$this->removeFolder($entity);
		} elseif ($entity instanceof File) {
			$this->removeFile($entity);
		} else {
			throw new Exception\LogicException('Not recognized file type passed: ' . get_class($entity));
		}
	}
public function remove(FileAbstraction $entity)
	{
		$eventArgs = new FileEvent();
		$eventArgs->setFile($entity);
		$this->fireFileEvent(FileEvent::FILE_EVENT_PRE_DELETE, $eventArgs);

		if ($entity instanceof Folder) {
			$hasChildren = $entity->hasChildren();
			if ($hasChildren) {
				throw new Exception\NotEmptyException('You can remove only empty folders');
			}
			$this->removeFolder($entity);
		} elseif ($entity instanceof File) {
			$this->removeFile($entity);
		} else {
			throw new Exception\LogicException('Not recognized file type passed: ' . get_class($entity));
		}
	}
public function remove ( FileAbstraction $ entity ) { $ eventArgs = new FileEvent ( ) ; $ eventArgs -> setFile ( $ entity ) ; $ this -> fireFileEvent ( FileEvent :: FILE_EVENT_PRE_DELETE , $ eventArgs ) ; if ( $ entity instanceof Folder ) { $ hasChildren = $ entity -> hasChildren ( ) ; if ( $ hasChildren ) { throw new Exception \ NotEmptyException ( 'You can remove only empty folders' ) ; } $ this -> removeFolder ( $ entity ) ; } elseif ( $ entity instanceof File ) { $ this -> removeFile ( $ entity ) ; } else { throw new Exception \ LogicException ( 'Not recognized file type passed: ' . get_class ( $ entity ) ) ; } }
Remove file or folder from database and system
@param FileAbstraction $entity
Remove file or folder from database and system