/**
  * preDelete.
  *
  * @param Doctrine_Event $event.
  */
 public function preDelete($event)
 {
     $record = $event->getInvoker();
     //Delete folder contents
     foreach ($record->getAssets() as $a) {
         $a->delete();
     }
     $fs = new lyMediaFileSystem();
     $fs->rmdir($record->getRelativePath());
 }
 /**
  * preDelete.
  *
  * @param Doctrine_Event $event.
  */
 public function preDelete($event)
 {
     $record = $event->getInvoker();
     $fs = new lyMediaFileSystem();
     if ($fs->is_writable($record->getNode()->getParent()->getRelativePath())) {
         //Delete folder contents
         foreach ($record->getAssets() as $a) {
             $a->delete();
         }
     }
     $fs->rmdir($record->getRelativePath());
 }