◆ __construct()
__construct |
( |
|
$fileref, |
|
|
|
$file = null |
|
) |
| |
StandardFile constructor.
- Parameters
-
| $fileref | |
null | $file | : (optional) Is set if fileref and file are both new and not connected with each other in the database. |
Implements StandardFileInterface.
◆ attachFile()
This is a method special to the LibraryFile class. It handles the attachment of a (real) File object to this LibraryFile. In that case, the library metadata must be transferred from the (virtual) file that is attached to the LibraryFile to the specified file that shall be attached.
- Parameters
-
- Exceptions
-
Exception | In case of an error, an exception with an error message is thrown. |
◆ createFromLibraryDocument()
static createFromLibraryDocument |
( |
LibraryDocument |
$document, |
|
|
|
$folder_id = null , |
|
|
|
$user_id = null |
|
) |
| |
|
static |
◆ getActionmenu()
◆ getDownloads()
Returns the number of downloads this file already has. Returns null if information is not available.
- Returns
- integer|null
Implements FileType.
◆ getDownloadURL()
Returns the URL to download the file. May be sendfile.php?... or an external link.
- Returns
- string|null
Implements FileType.
◆ getFile()
◆ getFilename()
Filename of the FileType-object.
- Returns
- mixed
Implements FileType.
◆ getFileNameFromDocument()
Extracts a file name from a LibraryDocument instance. This is an internal helper method.
- Parameters
-
LibraryDocument | $document | The document from which a file name shall be extracted. |
- Returns
- string The extracted file name.
◆ getFileRef()
◆ getIcon()
Returns the name of the icon shape that shall be used with the FileType implementation.
- Parameters
-
- Returns
- Icon icon for the FileType implementation.
Implements FileType.
◆ getInfoDialogButtons()
getInfoDialogButtons |
( |
array |
$extra_link_params = [] | ) |
|
Returns a list of Stud.IP button objects that represent actions that shall be visible for the file type in the info dialog.
- Parameters
-
array | $extra_link_params | An optional array of URL parameters that should be added to Button URLs, if reasonable. The parameter names are the keys of the array while their values are also the array item values. |
- Returns
- Interactable[] A list of Stud.IP buttons (LinkButton or Button).
Implements FileType.
◆ getInfoTemplate()
getInfoTemplate |
( |
bool |
$include_downloadable_infos = false | ) |
|
Generates a Flexi containing additional information that are displayes in the information dialog of a file.
- Parameters
-
bool | $include_downloadable_infos | Whether to include information like file previews that can be downloaded (true) or to not include them (false). Defaults to false. |
- Returns
- Flexi|null Either a Flexi containing additional information or null if no such information shall be displayed in the information dialog.
Implements FileType.
◆ getPath()
Returns the (real) file system path for the file. This is only relevant for FileType implementations storing real files on the server disk. Other implementations shall just return an empty string.
- Returns
- The file system path for the file or an empty string if the file doesn't have a path in the file system.
Implements FileType.
◆ getSize()
Returns the size of the file in bytes. If this is null, the file doesn't exist physically - is probably only a weblink or a request for libraries.
- Returns
- integer|null
Implements FileType.
◆ hasFileAttached()
This method checks if a real file is attached to this library file.
- Returns
- bool True, if a real file is attached, false otherwise.
◆ hasURL()
◆ isEditable()
isEditable |
( |
|
$user_id = null | ) |
|
Determines if a user may edit the file.
- Parameters
-
string | $user_id | The user who wishes to edit the file. |
- Returns
- boolean True, if the user is permitted to edit the file, false otherwise.
Implements FileType.
◆ removeDataFile()
◆ updateFromLibraryDocument()
Updates the LibraryFile by using a LibraryDocument instance.
- Parameters
-
- Returns
- bool True, if the update was successful, false otherwise.
◆ $library_document
The documentation for this class was generated from the following file: