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.
Afficher le fichier
Open project: dereuromark/cakephp-tools
Class Usage Examples
Protected Properties
Méthodes publiques
Méthodes protégées
Method Details
_containsBit()
protected méthode
beforeFind()
public méthode
public beforeFind ( Cake\Event\Event $event, Query $query ) : void |
$event |
Cake\Event\Event |
|
$query |
Cake\ORM\Query |
|
Résultat |
void |
|
beforeRules()
public méthode
public beforeRules ( Cake\Event\Event $event, Cake\ORM\Entity $entity, ArrayObject $options ) : void |
$event |
Cake\Event\Event |
|
$entity |
Cake\ORM\Entity |
|
$options |
ArrayObject |
|
Résultat |
void |
|
beforeSave()
public méthode
public beforeSave ( Cake\Event\Event $event, Cake\ORM\Entity $entity, ArrayObject $options ) : void |
$event |
Cake\Event\Event |
|
$entity |
Cake\ORM\Entity |
|
$options |
ArrayObject |
|
Résultat |
void |
|
containsBit()
public méthode
containsNotBit()
public méthode
decodeBitmask()
public méthode
encodeBitmask()
public méthode
encodeBitmaskConditions()
public méthode
encodeBitmaskData()
public méthode
initialize()
public méthode
isNotBit()
public méthode
Property Details
$_defaultConfig protected_oe property
protected array $_defaultConfig |
Résultat |
array |
|