/**
  * Completely remove a document from the Deleted/ folder
  *
  * return boolean true on successful expunge
  */
 function expunge($oDocument)
 {
     parent::expunge($oDocument);
     $oConfig =& KTConfig::getSingleton();
     $sCurrentPath = $this->getPath($oDocument);
     // check if the deleted folder exists and create it if not
     $sDeletedPrefix = sprintf("%s/Deleted", $oConfig->get('urls/documentRoot'));
     $sDocumentRoot = $oConfig->get('urls/documentRoot');
     $aVersions = KTDocumentContentVersion::getByDocument($oDocument);
     foreach ($aVersions as $oVersion) {
         $sPath = sprintf("Deleted/%s-%s", $oVersion->getId(), $oVersion->getFileName());
         $sFullPath = sprintf("%s/%s", $sDocumentRoot, $sPath);
         if (file_exists($sFullPath)) {
             unlink($sFullPath);
         }
     }
     return true;
 }
 /**
  * Completely remove a document from the Deleted/ folder
  *
  * return boolean true on successful expunge
  */
 function expunge($oDocument)
 {
     parent::expunge($oDocument);
     $oConfig =& KTConfig::getSingleton();
     $sCurrentPath = $this->getPath($oDocument);
     $sDocumentRoot = $oConfig->get('urls/documentRoot');
     $aVersions = KTDocumentContentVersion::getByDocument($oDocument);
     foreach ($aVersions as $oVersion) {
         $sPath = sprintf('%s/%s', $sDocumentRoot, $oVersion->getStoragePath());
         @unlink($sPath);
     }
     return true;
 }