Stud.IP  4.2 Revision
MessageFolder Class Reference
Inheritance diagram for MessageFolder:
Inheritance graph
Collaboration diagram for MessageFolder:
Collaboration graph

Public Member Functions

 __construct ($folder=null)
 
 __get ($attribute)
 
 getIcon ($role)
 
 getId ()
 
 isVisible ($user_id)
 
 isReadable ($user_id)
 
 isWritable ($user_id)
 
 isEditable ($user_id)
 
 isSubfolderAllowed ($user_id)
 
 getDescriptionTemplate ()
 
 getSubfolders ()
 
 getFiles ()
 
 getParent ()
 
 getEditTemplate ()
 
 setDataFromEditTemplate ($request)
 
 validateUpload ($uploaded_file, $user_id)
 
 createFile ($file)
 
 deleteFile ($file_ref_id)
 
 store ()
 
 createSubfolder (FolderType $folderdata)
 
 deleteSubfolder ($subfolder_id)
 
 delete ()
 
 isFileDownloadable ($file_ref_id, $user_id)
 
 isFileEditable ($file_ref_id, $user_id)
 
 isFileWritable ($file_ref_id, $user_id)
 

Static Public Member Functions

static findTopFolder ($message_id)
 
static createTopFolder ($message_id)
 
static getNumMessageAttachments ($message_id)
 
static availableInRange ($range_id_or_object, $user_id)
 
static getTypeName ()
 

Protected Attributes

 $folder
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $folder = null)
Parameters
Folder|nullfolder The folder object for this FolderType
Here is the call graph for this function:

Member Function Documentation

◆ __get()

__get (   $attribute)
Parameters
string$attribute
Returns
mixed

◆ availableInRange()

static availableInRange (   $range_id_or_object,
  $user_id 
)
static

This method returns always false since MessageFolder types are not creatable in standard folders. They are a standalone folder type.

Implements FolderType.

◆ createFile()

createFile (   $file)

This method handles creating a file inside the MessageFolder.

Parameters
File | array$fileThe file that shall be created inside the MessageFolder.
Returns
FileRef|null On success, a FileRef for the given file is returned. Null otherwise.

Implements FolderType.

Here is the call graph for this function:

◆ createSubfolder()

createSubfolder ( FolderType  $folderdata)

MessageFolders cannot have subfolders.

Implements FolderType.

◆ createTopFolder()

static createTopFolder (   $message_id)
static

Creates a root folder (top folder) for a message referenced by its ID.

Parameters
string$message_idThe ID of a message for which a root folder shall be generated.
Returns
MessageFolder A new MessageFolder as root folder for a message.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ delete()

delete ( )

Deletes the MessageFolder object.

Returns
True, if the MessageFolder has been deleted successfully, false otheriwse.

Implements FolderType.

◆ deleteFile()

deleteFile (   $file_ref_id)

Handles the deletion of a file inside this folder.

Parameters
string$file_ref_idThe ID of the FileRef whose file shall be deleted.
Returns
True, if the file has been deleted successfully, false otherwise.

Implements FolderType.

◆ deleteSubfolder()

deleteSubfolder (   $subfolder_id)

MessageFolders cannot have subfolders.

Implements FolderType.

◆ findTopFolder()

static findTopFolder (   $message_id)
static

Retrieves or creates the top folder for a message.

Creating top folders for messages is a special task since message attachments can be stored when the message wasn't sent yet. This means that message attachments of an unsent message are stored in a top folder with a range-ID that doesn't belong to a message table entry (yet). Therefore we must create the top folder manually when we can't find the top folder by the method Folder::getTopFolder.

Parameters
string$message_idThe message-ID of the message whose top folder shall be returned
Returns
MessageFolder|null The top folder of the message identified by $message_id. If the folder can't be retrieved, null is returned.
Here is the caller graph for this function:

◆ getDescriptionTemplate()

getDescriptionTemplate ( )

MessageFolders don't have a description template.

Implements FolderType.

◆ getEditTemplate()

getEditTemplate ( )

MessageFolders don't have an edit template.

Implements FolderType.

◆ getFiles()

getFiles ( )

Returns the files of this MessageFolder (e.g. the attachments of a message).

Returns
FileRef[] An array of FileRef objects containing all files that are placed inside this folder.

Implements FolderType.

◆ getIcon()

getIcon (   $role)

Returns the Icon object for the MessageFolder type.

Implements FolderType.

Here is the call graph for this function:

◆ getId()

getId ( )

Returns the ID of the folder object of this MessageFolder.

Implements FolderType.

◆ getNumMessageAttachments()

static getNumMessageAttachments (   $message_id)
static

Returns the amount of attachments for a message.

Parameters
string$message_idThe ID of a message.
Returns
int The amount of attachments that have been found for the message.
Here is the call graph for this function:

◆ getParent()

getParent ( )

MessageFolders don't have parents.

Implements FolderType.

◆ getSubfolders()

getSubfolders ( )

MessageFolders don't have subfolders.

Implements FolderType.

◆ getTypeName()

static getTypeName ( )
static

Returns a localised name of the MessageFolder type.

Implements FolderType.

◆ isEditable()

isEditable (   $user_id)

MessageFolders are never editable.

Implements FolderType.

◆ isFileDownloadable()

isFileDownloadable (   $file_ref_id,
  $user_id 
)

See method MessageFolder::isReadable

Implements FolderType.

Here is the call graph for this function:

◆ isFileEditable()

isFileEditable (   $file_ref_id,
  $user_id 
)

Files inside MessageFolders are not editable.

Implements FolderType.

◆ isFileWritable()

isFileWritable (   $file_ref_id,
  $user_id 
)

Files inside MessageFolders are not writable.

Implements FolderType.

◆ isReadable()

isReadable (   $user_id)

This method checks if a specified user can read the MessageFolder object.

Parameters
string$user_idThe ID of the user whose read permission shall be checked.
Returns
True, if the user, specified by $user_id, can read the folder, false otherwise.

Implements FolderType.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSubfolderAllowed()

isSubfolderAllowed (   $user_id)

MessageFolders will never allow subfolders.

Implements FolderType.

◆ isVisible()

isVisible (   $user_id)

See method MessageFolder::isReadable.

Implements FolderType.

Here is the call graph for this function:

◆ isWritable()

isWritable (   $user_id)

MessageFolders are only writable for their owners.

Implements FolderType.

◆ setDataFromEditTemplate()

setDataFromEditTemplate (   $request)

MessageFolders don't have an edit template and therefore cannot handle requests from such templates.

Implements FolderType.

◆ store()

store ( )

Stores the MessageFolder object.

Returns
True, if the MessageFolder has been stored successfully, false otheriwse.

Implements FolderType.

◆ validateUpload()

validateUpload (   $uploaded_file,
  $user_id 
)

This method handles file upload validation.

Parameters
array$uploaded_fileThe uploaded file that shall be validated.
string$user_idThe user who wishes to upload a file in this MessageFolder.
Returns
string|null An error message on failure, null on success.

Implements FolderType.

Here is the call graph for this function:

Field Documentation

◆ $folder

$folder
protected

The documentation for this class was generated from the following file: