Exemplo n.º 1
0
 /**
  * @param Folder $folder
  * @param string $newName
  * @return bool
  */
 function RenameFolder(&$folder, $newName)
 {
     $result = $this->_dbConnection->Execute($this->_commandCreator->RenameFolder($folder, $newName));
     //$newSubPath = substr($folder->FullName, 0,
     //			strrpos(trim($folder->FullName, $this->Account->Delimiter), $this->Account->Delimiter));
     //$newSubPath .= $newName;
     $foldersId = array();
     if ($this->_dbConnection->Execute($this->_commandCreator->SelectSubFoldersId($folder))) {
         while ($row = $this->_dbConnection->GetNextRecord()) {
             $foldersId[] = $row->id_folder;
         }
     }
     if (count($foldersId) > 0) {
         $result &= $this->_dbConnection->Execute($this->_commandCreator->RenameSubFoldersPath($folder, $foldersId, $newName));
     }
     return $result;
 }