mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-07-06 04:51:32 -07:00
Added a file move method
This commit is contained in:
parent
bdd06aa0b7
commit
6b438e0b9a
3 changed files with 49 additions and 0 deletions
|
@ -224,6 +224,19 @@ class File
|
|||
return new self($this->space, $newFilename);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $newFilename
|
||||
*
|
||||
* @return \SpacesAPI\File
|
||||
*/
|
||||
public function move(string $newFilename): File
|
||||
{
|
||||
$newFile = $this->copy($newFilename, $this->isPublic());
|
||||
$this->delete();
|
||||
|
||||
return $newFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the public URL
|
||||
* This URL will not work if the file is private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue