PHP Class Tools\Model\Behavior\BitmaskedBehavior
An implementation of bitwise masks for row-level operations.
You can submit/register flags in different ways. The easiest way is using a static model function.
It should contain the bits like so (starting with 1):
1 => w, 2 => x, 4 => y, 8 => z, ... (bits as keys - names as values)
The order doesn't matter, as long as no bit is used twice.
The theoretical limit for a 64-bit integer would be 64 bits (2^64).
But if you actually seem to need more than a hand full you
obviously do something wrong and should better use a joined table etc.
Exibir arquivo
Open project: dereuromark/cakephp-tools
Class Usage Examples
Protected Properties
Public Methods
Protected Methods
Method Details
_containsBit()
protected method
beforeFind()
public method
public beforeFind ( Cake\Event\Event $event, Query $query ) : void |
$event |
Cake\Event\Event |
|
$query |
Cake\ORM\Query |
|
return |
void |
|
beforeRules()
public method
public beforeRules ( Cake\Event\Event $event, Cake\ORM\Entity $entity, ArrayObject $options ) : void |
$event |
Cake\Event\Event |
|
$entity |
Cake\ORM\Entity |
|
$options |
ArrayObject |
|
return |
void |
|
beforeSave()
public method
public beforeSave ( Cake\Event\Event $event, Cake\ORM\Entity $entity, ArrayObject $options ) : void |
$event |
Cake\Event\Event |
|
$entity |
Cake\ORM\Entity |
|
$options |
ArrayObject |
|
return |
void |
|
containsBit()
public method
containsNotBit()
public method
decodeBitmask()
public method
encodeBitmask()
public method
encodeBitmaskConditions()
public method
encodeBitmaskData()
public method
initialize()
public method
Property Details
$_defaultConfig protected_oe property
protected array $_defaultConfig |
return |
array |
|