Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

The AMI_ModForm class

AMI_ModComponent
   |
   --AMI_ModForm

• Introduction

Module form component action controller.

• Class synopsis

AMI_ModForm extends AMI_ModComponent {
/* Constants */
// Flag specified that save is failed.
const AMI_ModForm::SAVE_FAILED =  0;
// Flag specified that save is succeed.
const AMI_ModForm::SAVE_SUCCEED =  1;
/* Properties */
// Array of actions processed by form
protected array $aActions = array('display', 'edit', 'save', 'show');
// File factory resource id
protected string $fileFactoryResId = 'env/file';
// Table item model
protected AMI_ModTableItem|null $oItem;
/* Inherited Properties */
// Flag specifying to use model
protected AMI_ModComponent::$useModel = TRUE;
/* Methods */
// Display action handler.
public dispatchDisplay ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
// Edit action handler.
public dispatchEdit ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
// Save action handler.
public dispatchSave ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
// Show action handler.
public dispatchShow ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
// Returns component type.
public getType ( ) returns string;
// Returns component view.
public getView ( ) returns AMI_ModFormView;
// Initialization.
public init ( ) returns AMI_ModForm;
// Returns true if component needs to be started always in full environment.
public isFullEnv ( ) returns bool;
// Save action dispatcher.
public _save ( &$aEvent ) returns void;
// Returns module file storage path.
protected getFileStoragePath ( ) returns string;
// Returns uploaded file codes.
protected getUploadedFileCodes ( ) returns array;
// Do something when data is not saved and exception is called.
protected onSaveException ( $aEvent ) returns array;
// Edit action dispatcher.
protected _edit ( &$aEvent ) returns void;
/* Inherited Methods */
// Returns true if component needs to be started always in full environment.
public AMI_ModComponent::isFullEnv ( ) returns bool;
// Sets module id.
public AMI_ModComponent::setModId ( string $modId ) returns AMI_ModComponent;
// Returns module id.
protected AMI_ModComponent::getModId ( ) returns string;
// Returns serial id.
protected AMI_ModComponent::getSerialId ( ) returns string;
// Initializes model.
protected AMI_ModComponent::initModel ( ) returns AMI_ModTable|null;
}
Tags:
abstract
since 5.12.0

• Class Constants

SAVE_FAILED

Flag specified that save is failed.

SAVE_SUCCEED

Flag specified that save is succeed.

• Class Properies

protected array $aActions

Array of actions processed by form

protected string $fileFactoryResId

File factory resource id

protected AMI_ModTableItem|null $oItem

Table item model

Backward compatibility.

• Class Methods

// Display action handler.
public dispatchDisplay ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
  • string $name
    Event name
  • array $aEvent
    Event data
  • string $handlerModId
    Handler module id
  • string $srcModId
    Source module id
Event handler.
Tags:
see AMI_Event::fire()
see AMI_Event::addHandler()
since 5.14.8
// Edit action handler.
public dispatchEdit ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
  • string $name
    Event name
  • array $aEvent
    Event data
  • string $handlerModId
    Handler module id
  • string $srcModId
    Source module id
Event handler.
Tags:
see AMI_Event::fire()
see AMI_Event::addHandler()
since 5.14.8
// Save action handler.
public dispatchSave ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
  • string $name
    Event name
  • array $aEvent
    Event data
  • string $handlerModId
    Handler module id
  • string $srcModId
    Source module id
Event handler.
Tags:
see AMI_Event::fire()
see AMI_Event::addHandler()
since 5.14.8
// Show action handler.
public dispatchShow ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
  • string $name
    Event name
  • array $aEvent
    Event data
  • string $handlerModId
    Handler module id
  • string $srcModId
    Source module id
Event handler.
Tags:
see AMI_Event::fire()
see AMI_Event::addHandler()
since 5.14.8
// Returns component type.
public getType ( ) returns string;

Overridden in child classes as: AMI_ModFilter::getType().

// Returns component view.
public getView ( ) returns AMI_ModFormView;

Overridden in child classes as: AMI_ModFilter::getView().

// Returns true if component needs to be started always in full environment.
public isFullEnv ( ) returns bool;
// Save action dispatcher.
public _save ( &$aEvent ) returns void;
  • array &$aEvent
    Event data

Overridden in child classes as: AmiClean_AmiSample_FormAdm::_save(), AmiSample_FormAdm::_save().

Common admin module form action dispatching handler.
Tags:
since 5.14.8
// Returns module file storage path.
protected getFileStoragePath ( ) returns string;
// Returns uploaded file codes.
protected getUploadedFileCodes ( ) returns array;
// Do something when data is not saved and exception is called.
protected onSaveException ( $aEvent ) returns array;
  • array $aEvent
    Event array with exception, model item and error status
Tags:
since 6.0.2
// Edit action dispatcher.
protected _edit ( &$aEvent ) returns void;
  • array &$aEvent
    Event data
Common admin module form action dispatching handler.
Tags:
since 5.14.8