|
static | createTopFolder ($range_id, $range_type, $folder_type='RootFolder') |
|
static | findRangeTypeById ($range_id) |
|
static | findByTopic_id ($topic_id) |
|
static | findByTermin_id ($termin_id) |
|
static | findTopFolder ($range_id, $folder_type='RootFolder') |
|
static | tableScheme ($db_table) |
|
static | expireTableScheme () |
|
static | exists ($id) |
|
static | countBySql ($sql='1', $params=[]) |
|
static | create ($data) |
|
static | build ($data, $is_new=true) |
|
static | buildExisting ($data) |
|
static | import ($data) |
|
static | findBySQL ($sql, $params=[]) |
|
static | findOneBySQL ($where, $params=[]) |
|
static | findThru ($foreign_key_value, $options) |
|
static | findEachBySQL ($callable, $sql, $params=[]) |
|
static | findMany ($pks=[], $order='', $order_params=[]) |
|
static | findEachMany ($callable, $pks=[], $order='', $order_params=[]) |
|
static | findAndMapBySQL ($callable, $where, $params=[]) |
|
static | findAndMapMany ($callable, $pks=[], $order='', $order_params=[]) |
|
static | deleteBySQL ($where, $params=[]) |
|
static | toObject ($id_or_object) |
|
static | __callStatic (string $name, array $arguments) |
|
◆ cbLogDeleteFolder()
◆ cbMakeUniqueName()
This callback is called before storing a Folder object. In case the name field is changed this callback assures that the name of the Folder object is unique inside the parent folder.
◆ cbRemoveFeedbackElements()
cbRemoveFeedbackElements |
( |
| ) |
|
This callback is called after deleting a Folder. It removes feedback elements that are associated with the Folder.
◆ configure()
static configure |
( |
|
$config = [] | ) |
|
|
staticprotected |
◆ createTopFolder()
static createTopFolder |
( |
|
$range_id, |
|
|
|
$range_type, |
|
|
|
$folder_type = 'RootFolder' |
|
) |
| |
|
static |
Creates a top folder (root directory) for a Stud.IP object given by range_id and range_type.
This method creates and stores a top folder (root directory) for a Stud.IP object. To properly create such a folder this method requires the parameters range_id and range_type to be set.
- Parameters
-
string | $range_id | The ID of the Stud.IP object |
string | $range_type | The type of the object: "course", "inst", "user", ... |
- Returns
- Folder Created Folder object.
◆ fileExists()
Checks if a file or folder with a given file name exists inside the folder.
By looking at the number of associated FileRef objects and the number of associated Folder objects this method determines if a file or folder with a given name exists inside the folder.
- Parameters
-
string | $file_name | The file name of the file or folder which is searched. |
- Returns
- bool Returns true, if a file was found, false otherwise.
◆ findByTermin_id()
static findByTermin_id |
( |
|
$termin_id | ) |
|
|
static |
Retrieves folders by the ID of a CourseDate object.
- Parameters
-
- Returns
- Folder[] An array with one folder object matching the $termin_id if such a folder can be found. Null otherwise.
◆ findByTopic_id()
static findByTopic_id |
( |
|
$topic_id | ) |
|
|
static |
Retrieves folders by the ID of a CourseTopic object.
- Parameters
-
- Returns
- Folder[] An array with one folder object matching the topic-ID if such a folder can be found. Null otherwise.
◆ findRangeTypeById()
static findRangeTypeById |
( |
|
$range_id | ) |
|
|
static |
Determines the range type by probing the given range ID.
This is a helper method that can be used in conjunction with the createTopFolder method. In case when only the ID of a Stud.IP object is given, this method will help to determine the corresponding object type.
- Parameters
-
string | $range_id | The ID of an object whose type shall be determined. |
- Returns
- bool|string Returns false on failure, otherwise the name of the range.
◆ findTopFolder()
static findTopFolder |
( |
|
$range_id, |
|
|
|
$folder_type = 'RootFolder' |
|
) |
| |
|
static |
Find the top folder of a Stud.IP object or create it, if it doesn't exist.
This method finds the top folder (root directory) of a course, institute, personal file area or a message by the ID given in the range_id parameter. If the root folder doesn't exist, it will be created.
Note that the range_id parameter is mandatory!
- Parameters
-
string | range_id The ID of the Stud.IP object whose top folder shall be found. |
string | folder_type The expected folder type related to the Stud.IP object (defaults to RootFolder, use MessageFolder for the top folder of a message) |
- Returns
- Folder|null Folder object on success or null, if no folder can be created.
◆ getParents()
Returns a list of parent folders, starting with the top folder.
This method returns a list with the parent folders of the folder until the top folder (root directory) is found. The list is reversed so that it starts with the top folder and ends with this folder.
- Returns
- [] An array of parent folders, starting with the top folder.
◆ getPath()
getPath |
( |
|
$delimiter = '/' | ) |
|
Returns the file system path from the top folder to this folder.
By calling the getParents method of this class and getting the names of the parent folders the path is created. The default path separator is a slash, but it can be overwritten by specifying the $delimiter parameter.
- Parameters
-
string | $delimiter | The character to be used as path separator. |
- Returns
- string The path from the top folder to this folder, separated by the character set in $delimiter.
◆ getRangeCourseId()
◆ getRangeIcon()
◆ getRangeName()
◆ getRangeUrl()
Returns the URL of FeedbackRange view, where the object instance is visible together with the related feedback element(s).
- Returns
- string Path that is usable with the url_for and link_for methods.
Implements FeedbackRange.
◆ getTypedFolder()
Gets the FolderType object for the current folder.
The FolderType class defines extended attributes for a folder. With this method the associated FolderType of a folder can be determined.
- Returns
- FolderType An object of a FolderType derivate.
- Exceptions
-
UnexpectedValueException | If the class specified by the folder's folder_type attribute can't be found an Exception is thrown. |
◆ getUniqueName()
getUniqueName |
( |
|
$file_name, |
|
|
|
$folder_naming_mode = false |
|
) |
| |
Makes a given file name unique and returns the altered file name.
The file and folder names in a folder must be unique. This helper method will check, if a file or folder with the name given by the parameter $file_name exists and if so, it will append a number in square brackets to the file name to make it unique. The unique file name is returned.
- Parameters
-
string | $file_name | The file name that shall be checked for uniqueness. |
bool | $folder_naming_mode | Enable (true) or disable (false) the Folder naming mode. The default is false (disabled). If folder naming mode is set to true, the number in square brackets is appended to the end of the name instead of being inserted before the last dot in the name. |
- Returns
- string An unique filename.
◆ isRangeAccessible()
isRangeAccessible |
( |
string |
$user_id = null | ) |
|
Returns the accessebility of FeedbackRange object instance for current active user
- Parameters
-
string | $user_id | optional; use this ID instead of $GLOBALS['user']->id |
- Returns
- bool range object accessebility
Implements FeedbackRange.
◆ linkFile()
linkFile |
( |
|
$file_or_id, |
|
|
|
$file_ref_data = [] |
|
) |
| |
Creates a FileRef object for a given File object or its ID.
This method creates a FileRef object for a file that is represented by its object or its ID. The new FileRef's description is different than the one from the file since it is set via the $description parameter. Furthermore license information can be stored via the $license parameter.
- Parameters
-
File | string | $file_or_id | Either a file object or a string containing a File object's ID. |
array | $file_ref_data | The description for the file that shall be used in the FileRef object. |
- Returns
- FileRef|null On success a FileRef for the given file is returned. On failure, null is returned.
◆ unlinkFileRef()
unlinkFileRef |
( |
|
$fileref_or_id | ) |
|
Removes a file reference.
- Parameters
-
- Returns
- int|bool Returns the amount of deleted databasw rows on success or false on failure.
The documentation for this class was generated from the following file: