public function renameById($pId, $pPath) { $p = $this->getPathById($pId); $e = explode('.', $p); $ext = end($e); $pPath .= "." . $ext; if ($p === $pPath) { return; } File::rename($p, $pPath); $this->updateUpload($pId, $pPath); }
/** * @param $pNewName * @return void */ public function renameFolder($pNewName) { File::rename($this->pathFile, $pNewName . $this->fileName . "." . $this->fileType); $this->folder = $pNewName; $this->pathFile = $this->folder . $this->fileName . "." . $this->fileType; $this->model_upload->updateById($this->id_upload, array("path_upload" => $this->pathFile)); }