|
HCE Project DC service web UI
0.2
Hierarchical Cluster Engine DC service web UI
|
Public Member Functions | |
| beforeSave ($event) | |
| afterSave ($event) | |
| afterFind ($event) | |
| checkState ($states) | |
| convertAttribute ($type= 'auto') | |
| getStatesData () | |
| statesIncluded ($states) | |
| statesExact ($states) | |
| statesAtLeast ($states) | |
| validateStates ($states) | |
Static Public Member Functions | |
| static | createBitMask ($states, $data) |
Public Attributes | |
| $attribute = 'states' | |
| $data = array() | |
| $convertBeforeSave = true | |
| $convertAfterSave = true | |
| $convertAfterFind = true | |
Private Member Functions | |
| toDatabaseInt () | |
| convertStates ($states) | |
| toOutputArray () | |
CActiveRecordBehavior for converting checkBoxList data to INT database field Converts data of multiple checkboxes to int representation by setting bits of integer value (like at *nix chmod command).
Definition at line 115 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::afterFind | ( | $event | ) |
AfterFind attribute conversion to ARRAY format.
| CEvent | $event |
Definition at line 277 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::afterSave | ( | $event | ) |
AfterSave attribute conversion to ARRAY format.
| CEvent | $event |
Definition at line 243 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::beforeSave | ( | $event | ) |
BeforeSave attribute conversion to INT format.
| CEvent | $event |
Definition at line 167 of file StatesBinaryFieldBehavior.php.

| StatesBinaryFieldBehavior::checkState | ( | $states | ) |
Checking of key state Checking makes regardless to current conversion format. If multiple states given, returns true only if all of them is set.
Usage: if ($model->checkState(array('state1','state3'))) echo 'States 1 and 3 is set';
| array | $states | Selected keys of { |
Definition at line 299 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::convertAttribute | ( | $type = 'auto' | ) |
Converts attribute to given or opposite format Options: int - convert attribute to INT database format arr - convert attribute to ARRAY format (like: array('state1','state3')) note: array format may be used in {
| string | $type | Type of conversion. Default set to 'auto'. |
Definition at line 344 of file StatesBinaryFieldBehavior.php.
|
private |
Converts states array to integer representation.
| array | $states |
Definition at line 194 of file StatesBinaryFieldBehavior.php.
|
static |
Creates integer representation of given states.
Usage:
$states=array('state1','state3'); $data=array( 'state1'=>'First model state', 'state2'=>'Second model state', 'state3'=>'Third model state', ); $bitmask=StatesBinaryFieldBehavior::createBitMask($states,$data); // Returns integer: 5
| array | $states | Array of setted states |
| data | $data | Array of all available states |
Definition at line 224 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::getStatesData | ( | ) |
States data.
Definition at line 365 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::statesAtLeast | ( | $states | ) |
Adds ARModel conditions for selecting records including at least one of given states.
| array | $states | Array of states. Example: array('state1','state3') |
Definition at line 419 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::statesExact | ( | $states | ) |
Adds ARModel conditions for selecting records including exactly given states.
| array | $states | Array of states. Example: array('state1','state3') |
Definition at line 398 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::statesIncluded | ( | $states | ) |
Adds ARModel conditions for selecting records including all given states.
| array | $states | Array of states. Example: array('state1','state3') |
Definition at line 377 of file StatesBinaryFieldBehavior.php.
|
private |
Converts attribute to database INT format Only if attribute value is array.
Definition at line 178 of file StatesBinaryFieldBehavior.php.

|
private |
Converts attribute to output ARRAY format Array format may be used in {
Definition at line 256 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::validateStates | ( | $states | ) |
Definition at line 437 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::$attribute = 'states' |
Definition at line 120 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::$convertAfterFind = true |
Definition at line 160 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::$convertAfterSave = true |
Definition at line 152 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::$convertBeforeSave = true |
Definition at line 145 of file StatesBinaryFieldBehavior.php.
| StatesBinaryFieldBehavior::$data = array() |
Definition at line 138 of file StatesBinaryFieldBehavior.php.