|
| $resourceType |
|
| $folder |
|
| $errors = [] |
|
| $metadata |
|
| $backend |
|
| $fileName |
|
| $config |
|
| $app |
|
The ExistingFile class.
Represents a file that already exists in CKFinder and can be pointed using the resource type, path and file name.
◆ __construct()
Constructor.
- Parameters
-
string | $fileName | |
string | $folder | |
Reimplemented in CopiedFile, and MovedFile.
◆ addError()
Adds an error to the array of errors of the current file.
- Parameters
-
- See also
- Error
◆ deleteResizedImages()
Removes resized images generated for the current file.
- Returns
- bool
true
if resized images were found and deleted
◆ deleteThumbnails()
Removes the thumbnail generated for the current file.
- Returns
- bool
true
if the thumbnail was found and deleted
- Exceptions
-
◆ exists()
Checks if the current file exists.
- Returns
- bool
true
if the file exists
- Exceptions
-
Reimplemented in DownloadedFile.
◆ getContents()
Returns file contents.
- Returns
- string contents stream
- Exceptions
-
◆ getContentsStream()
Returns file contents stream.
- Returns
- resource contents stream
◆ getErrors()
Returns an array of errors that occurred during file processing.
◆ getFilePath()
Returns backend-relative file path.
- Returns
- string file path
◆ getMimeType()
Returns file MIME type.
- Returns
- string file MIME type
- Exceptions
-
◆ getPath()
Returns backend-relative folder path (i.e. a path with a prepended resource type directory).
- Returns
- string backend-relative path
◆ getResourceType()
Returns the resource type of the file.
◆ getSize()
Returns file size.
- Returns
- int size in bytes
- Exceptions
-
◆ getTimestamp()
Returns last modification time.
- Returns
- int Unix timestamp
- Exceptions
-
◆ hasAllowedExtension()
Checks if the current file has an extension allowed in its resource type.
- Returns
- bool
true
if the file has an allowed exception
Reimplemented in CopiedFile, and DownloadedFile.
◆ hasHiddenPath()
Checks if the current file has a hidden path (i.e. if any of the parent folders is hidden).
- Returns
- bool
true
if the path is hidden
◆ hasValidPath()
Checks if the current file folder path is valid.
- Returns
- bool
true
if the path is valid
◆ isHidden()
Checks if the current file is hidden.
- Returns
- bool
true
if the file is hidden
Reimplemented in DownloadedFile.
◆ save()
save |
( |
|
$contents, |
|
|
|
$filePath = null |
|
) |
| |
Sets new file contents.
- Parameters
-
string | $contents | file contents |
string | $filePath | path to save the file |
- Returns
- bool
true
if saved successfully
- Exceptions
-
Exception if content size is too big
Reimplemented in EditedFile.
The documentation for this class was generated from the following file: