Class MassAction
CComponent is the base class for all components.
CComponent implements the protocol of defining, using properties and events.
A property is defined by a getter method, and/or a setter method. Properties can be accessed in the way like accessing normal object members. Reading or writing a property will cause the invocation of the corresponding getter or setter method, e.g
$a=$component->text; // equivalent to $a=$component->getText(); $component->text='abc'; // equivalent to $component->setText('abc');
The signatures of getter and setter methods are as follows,
// getter, defines a readable property 'text' public function getText() { ... } // setter, defines a writable property 'text' with $value to be set to the property public function setText($value) { ... }
An event is defined by the presence of a method whose name starts with 'on'. The event name is the method name. When an event is raised, functions (called event handlers) attached to the event will be invoked automatically.
An event can be raised by calling CComponent::raiseEvent()
method, upon which the
attached event handlers will be invoked automatically in the order they are
attached to the event. Event handlers must have the following signature,
function eventHandler($event) { ... }
where $event includes parameters associated with the event.
To attach an event handler to an event, see CComponent::attachEventHandler()
. You
can also use the following syntax:
$component->onClick=$callback; // or $component->onClick->add($callback);
where $callback refers to a valid PHP callback. Below we show some callback examples:
'handleOnClick' // handleOnClick() is a global function array($object,'handleOnClick') // using $object->handleOnClick() array('Page','handleOnClick') // using Page::handleOnClick()
To raise an event, use CComponent::raiseEvent()
. The on-method defining an event is
commonly written like the following:
public function onClick($event) { $this->raiseEvent('onClick',$event); }
where <span class="php-var">$event</span>
is an
instance of CEvent or its child class. One can then raise the event by
calling the on-method instead of CComponent::raiseEvent()
directly.
Both property names and event names are case-insensitive.
CComponent supports behaviors. A behavior is an instance of IBehavior which is attached to a component. The methods of the behavior can be invoked as if they belong to the component. Multiple behaviors can be attached to the same component.
To attach a behavior to a component, call CComponent::attachBehavior()
; and to
detach the behavior from the component, call CComponent::detachBehavior()
.
A behavior can be temporarily enabled or disabled by calling CComponent::enableBehavior()
or CComponent::disableBehavior()
, respectively. When disabled, the
behavior methods cannot be invoked via the component.
Starting from version 1.1.0, a behavior's properties (either its public member variables or its properties defined via getters and/or setters) can be accessed through the component it is attached to.
- CComponent
- MassAction
Direct known subclasses
BaseDocsMassAction, MassAddToList, MassCompleteAction, MassRemoveFromList, MassUncompleteAction, NewListFromSelectionPackage: system\base
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/protected/components/X2GridView/massActions/MassAction.php
abstract public
string
|
|
abstract public
|
|
public
|
|
public
|
|
public static
array
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public static
|
|
protected static
|
|
public
|
|
public
|
|
public
|
|
public static
|
#
superMassActionPasswordConfirmation( )
Check user password and echo either an error message or a unique id which gets used on subsequent requests to ensure that the user confirmed the action with their password |
protected
|
|
protected
boolean
|
|
protected
array
|
#
getIdsFromSearchResults( string $modelClass )
Helper method for superExecute. Returns array of ids of records in search results. |
public
|
#
superExecute( string $uid, integer $totalItemCount, string $expectedIdChecksum )
Execute mass action on next batch of records |
protected
array
|
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|
string |
SESSION_KEY_PREFIX
|
'superMassAction' |
|
string |
SESSION_KEY_PREFIX_PASS_CONFIRM
|
'superMassActionPassConfirm' |
|
integer |
BAD_CHECKSUM
|
1 |
|
integer |
BAD_ITEM_COUNT
|
2 |
|
integer |
BAD_COUNT_AND_CHECKSUM
|
3 |
protected static
string
|
$responseForm | '' |
|
public
boolean
|
$hasButton | false |
#
$hasButton If true, mass action has a button, otherwise it is assumed that
the |
public
boolean
|
$allowMultiple | true |
#
$allowMultiple whether or not mass action should be allowed for multiple records |
public
|
$owner | null |
#
$owner |
protected
boolean
|
$requiresPasswordConfirmation | false |
#
If true, user must enter their password before super mass action can proceed |
protected
mixed
|
$_label |
|
|
protected static
array
|
$successFlashes | array () |
|
protected static
array
|
$noticeFlashes | array () |
|
protected static
array
|
$errorFlashes | array () |