/**
  * Also delete all contents
  *
  * @param Connection $con
  * @param Boolean $force If true, do not throw an exception if the physical directories cannot be removed
  */
 public function delete(Doctrine_Connection $con = null, $force = false)
 {
     static $inDelete;
     $this->getsfAssets()->delete();
     // delete node will call this method
     // so we have to avoid a recursive endless call.
     if (is_null($inDelete)) {
         $inDelete = true;
         $this->getNode()->delete();
         sfToolkit::clearDirectory($this->getFullPath());
         $inDelete = null;
     }
     return parent::delete($con);
 }
 /**
  * Removes this object and all descendants from datastore.
  *
  * @param      PropelPDO Connection to use.
  * @return     void
  * @throws     PropelException
  */
 public function delete(PropelPDO $con = null)
 {
     // delete node first
     parent::delete($con);
     // delete descendants and then shift tree
     sfAssetFolderPeer::deleteDescendants($this, $con);
 }
 /**
  * Also delete all contents
  *
  * @param Connection $con
  * @param Boolean $force If true, do not throw an exception if the physical directories cannot be removed
  */
 public function delete(Doctrine_connection $con = null, $force = false)
 {
     $success = true;
     $descendants = $this->getNode()->getDescendants();
     if ($descendants !== false) {
         foreach ($descendants as $descendant) {
             $success = $descendant->delete($con, $force) && $success;
         }
     }
     foreach ($this->getAssets() as $asset) {
         $success = $asset->delete() && $success;
     }
     // Remove thumbnail subdir
     $success = rmdir(sfAssetsLibraryTools::getThumbnailDir($this->getFullPath())) && $success;
     // Remove dir itself
     $success = rmdir($this->getFullPath()) && $success;
     if ($success || $force) {
         parent::delete($con);
     } else {
         throw new sfAssetException('Impossible to delete folder "%name%"', array('%name%' => $this->getName()));
     }
     return $success;
 }