Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
MessageFolder Class Reference
Inheritance diagram for MessageFolder:
StandardFolder FolderType FolderType

Public Member Functions

 __construct ($folder=null)
 
 __get ($attribute)
 
 getIcon ($role=Icon::DEFAULT_ROLE)
 
 getId ()
 
 isVisible ($user_id)
 
 isReadable ($user_id)
 
 isWritable ($user_id)
 
 isEditable ($user_id)
 
 isSubfolderAllowed ($user_id)
 
 getDescriptionTemplate ()
 
 getSubfolders ()
 
 getParent ()
 
 getEditTemplate ()
 
 setDataFromEditTemplate ($request)
 
 validateUpload (FileType $newfile, $user_id)
 
 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)
 
 copySettings ()
 
- Public Member Functions inherited from StandardFolder
 __construct ($folderdata=null)
 
 getIcon ($role=Icon::DEFAULT_ROLE)
 
 getId ()
 
 __get ($attribute)
 
 __set ($name, $value)
 
 isVisible ($user_id)
 
 isReadable ($user_id)
 
 isWritable ($user_id)
 
 isEditable ($user_id)
 
 isSubfolderAllowed ($user_id)
 
 getDescriptionTemplate ()
 
 getEditTemplate ()
 
 setDataFromEditTemplate ($request)
 
 store ()
 
 validateUpload (FileType $newfile, $user_id)
 
 getSubfolders ()
 
 getFiles ()
 
 getParent ()
 
 addFile (FileType $file, $user_id=null)
 
 deleteFile ($file_ref_id)
 
 createSubfolder (FolderType $foldertype)
 
 deleteSubfolder ($subfolder_id)
 
 delete ()
 
 isFileDownloadable ($fileref_or_id, $user_id)
 
 isFileEditable ($fileref_or_id, $user_id)
 
 isFileWritable ($fileref_or_id, $user_id)
 
 getRangeObject ()
 
 getAdditionalColumns ()
 
 getContentForAdditionalColumn ($column_index)
 
 getAdditionalColumnOrderWeigh ($column_index)
 
 getAdditionalActionButtons ()
 
 copySettings ()
 

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 ()
 
- Static Public Member Functions inherited from StandardFolder
static getTypeName ()
 
static availableInRange ($range_id_or_object, $user_id)
 

Protected Attributes

 $folder
 
- Protected Attributes inherited from StandardFolder
 $folderdata
 

Additional Inherited Members

- Static Public Attributes inherited from StandardFolder
static $sorter = 0
 
- Protected Member Functions inherited from StandardFolder
 isVisibleNonRecursive ($user_id)
 
 getValidationMessages ($upload_type, $newfile)
 

Constructor & Destructor Documentation

__construct (   $folder = null)
Parameters
Folder|nullfolder The folder object for this FolderType

Member Function Documentation

__get (   $attribute)
Parameters
string$attribute
Returns
mixed
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.

copySettings ( )
createSubfolder ( FolderType  $folderdata)

MessageFolders cannot have subfolders.

Implements FolderType.

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.
delete ( )

Deletes the MessageFolder object.

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

Implements FolderType.

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 (   $subfolder_id)

MessageFolders cannot have subfolders.

Implements FolderType.

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.
getDescriptionTemplate ( )

MessageFolders don't have a description template.

Implements FolderType.

getEditTemplate ( )

MessageFolders don't have an edit template.

Implements FolderType.

getIcon (   $role = Icon::DEFAULT_ROLE)

Returns the Icon object for the MessageFolder type.

Implements FolderType.

getId ( )

Returns the ID of the folder object of this MessageFolder.

Implements FolderType.

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.
getParent ( )

MessageFolders don't have parents.

Implements FolderType.

getSubfolders ( )

MessageFolders don't have subfolders.

Implements FolderType.

static getTypeName ( )
static

Returns a localised name of the MessageFolder type.

Implements FolderType.

isEditable (   $user_id)

MessageFolders are never editable.

Implements FolderType.

isFileDownloadable (   $file_ref_id,
  $user_id 
)

See method MessageFolder::isReadable

Implements FolderType.

isFileEditable (   $file_ref_id,
  $user_id 
)

Files inside MessageFolders are not editable.

Implements FolderType.

isFileWritable (   $file_ref_id,
  $user_id 
)

Files inside MessageFolders are not writable.

Implements FolderType.

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.

isSubfolderAllowed (   $user_id)

MessageFolders will never allow subfolders.

Implements FolderType.

isVisible (   $user_id)

See method MessageFolder::isReadable.

Implements FolderType.

isWritable (   $user_id)

MessageFolders are only writable for their owners.

Implements FolderType.

setDataFromEditTemplate (   $request)

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

Implements FolderType.

store ( )

Stores the MessageFolder object.

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

Implements FolderType.

validateUpload ( FileType  $newfile,
  $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.

Field Documentation

$folder
protected

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