Class MOXMAN_Vfs_FileActionEventArgs

InheritanceMOXMAN_Vfs_FileActionEventArgs » MOXMAN_Util_EventArgs

This class is used with the FileAction events as an argument.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructs a new action event. MOXMAN_Vfs_FileActionEventArgs
cancel() Cancels the action to be executed after the event. This is normally used in events called just before an action is to be performed. MOXMAN_Util_EventArgs
getAction() Gets the current action name. MOXMAN_Vfs_FileActionEventArgs
getData() Returns the custom data object. This can be used to pass custom information from one listener to another. MOXMAN_Vfs_FileActionEventArgs
getFile() Get the file instance for the event. MOXMAN_Vfs_FileActionEventArgs
getFileList() Returns an array of files for an list_files action. MOXMAN_Vfs_FileActionEventArgs
getSender() Returns the sender instance that dispatched the event. MOXMAN_Util_EventArgs
getTargetFile() Gets the optional target file. This will return null if the target file isn't set. MOXMAN_Vfs_FileActionEventArgs
isAction() Checks if the action matches the specified action. MOXMAN_Vfs_FileActionEventArgs
isCancelled() Returns true/false if the event is cancelled or not. This will block the action followed by the event. This is normally used to cancel an action on a event called before the action. MOXMAN_Util_EventArgs
isStopped() Returns true/false if the event is stopped. If it's stopped other event handlers won't be executed. MOXMAN_Util_EventArgs
setFile() Set the file instance for the event. MOXMAN_Vfs_FileActionEventArgs
setFileList() Sets a list of files for the file event. A file list can be for example in a list_files action. MOXMAN_Vfs_FileActionEventArgs
setSender() Sets the sender that dispatched the event. MOXMAN_Util_EventArgs
setTargetFile() Sets the target file for the action. Used in operations like copy or move. MOXMAN_Vfs_FileActionEventArgs
stop() Stops the event from being passed to other event handlers. MOXMAN_Util_EventArgs

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
ADD "add" Add file action. For example when a file is uploaded. MOXMAN_Vfs_FileActionEventArgs
COPY "copy" Copy file action. MOXMAN_Vfs_FileActionEventArgs
DELETE "delete" Delete file action. MOXMAN_Vfs_FileActionEventArgs
INSERT "insert" Insert file action. Will be used when a file is inserted into a form. MOXMAN_Vfs_FileActionEventArgs
LIST_FILES "list_files" List files action. Will be executed when files gets listed in a dir. MOXMAN_Vfs_FileActionEventArgs
MOVE "move" Move file action. Will be used when a file is moved or renamed. MOXMAN_Vfs_FileActionEventArgs

Property Details

$action protected property
protected string $action null
$data protected property
protected stdClass $data null
$file protected property
protected MOXMAN_Vfs_IFile $file null
$files protected property
protected array $files null
$targetFile protected property
protected MOXMAN_Vfs_IFile $targetFile null

Method Details

__construct() public method

Constructs a new action event.

public void __construct ( $action, MOXMAN_Vfs_IFile $file )
$action string

Action name to create.

$file MOXMAN_Vfs_IFile

File instance for the action.

getAction() public method

Gets the current action name.

public String getAction ( )
return String

Current action name.

getData() public method

Returns the custom data object. This can be used to pass custom information from one listener to another.

public stdClass getData ( )
return stdClass

Class instance with custom data.

getFile() public method

Get the file instance for the event.

public MOXMAN_Vfs_IFile getFile ( )
return MOXMAN_Vfs_IFile

File instance for the event.

getFileList() public method

Returns an array of files for an list_files action.

public array getFileList ( )
return array

Array of files.

getTargetFile() public method

Gets the optional target file. This will return null if the target file isn't set.

public MOXMAN_Vfs_IFile getTargetFile ( )
return MOXMAN_Vfs_IFile

Target file instance or null if it's not set.

isAction() public method

Checks if the action matches the specified action.

public boolean isAction ( $action )
$action string

Action to check if it matches with.

return boolean

True if the action matches, false if it doesn't.

setFile() public method

Set the file instance for the event.

public void setFile ( MOXMAN_Vfs_IFile $file )
$file MOXMAN_Vfs_IFile

File to set as the file.

setFileList() public method

Sets a list of files for the file event. A file list can be for example in a list_files action.

This enables you to alter the list of files before it's getting sent out to the client.

public void setFileList ( $files )
$files array

Array of file to list.

setTargetFile() public method

Sets the target file for the action. Used in operations like copy or move.

public void setTargetFile ( MOXMAN_Vfs_IFile $file )
$file MOXMAN_Vfs_IFile

File to set as the target file.