PHP Класс Tools\Model\Behavior\StringBehavior
Note that most string modification should be done once, on save.
Prevent using output modification if possible as it is done on every fetch.
Tip: If you have other behaviors that might modify the array data prior to saving, better use a higher priority:
$this->addBehavior('Tools.String', array('priority' => 11, ...));
So that it is run last.
Usage: See docs
Показать файл
Открыть проект
Защищенные свойства (Protected)
Открытые методы
Метод |
Описание |
|
_process ( string $val, array $map ) : string |
Process val via map |
|
beforeFind ( Cake\Event\Event $event, Query $query ) : void |
Decode the fields on after find |
|
beforeSave ( Cake\Event\Event $event, Cake\ORM\Entity $entity, ArrayObject $options ) : void |
Saves all fields that do not belong to the current Model into 'with' helper model. |
|
initialize ( array $config = [] ) : void |
|
|
processItems ( Cake\ORM\Entity $entity, string $type = 'input' ) : void |
Decodes the fields of an array/entity (if the value itself was encoded) |
|
Описание методов
_process()
публичный Метод
beforeFind()
публичный Метод
Decode the fields on after find
public beforeFind ( Cake\Event\Event $event, Query $query ) : void |
$event |
Cake\Event\Event |
|
$query |
Cake\ORM\Query |
|
Результат |
void |
|
beforeSave()
публичный Метод
Saves all fields that do not belong to the current Model into 'with' helper model.
public beforeSave ( Cake\Event\Event $event, Cake\ORM\Entity $entity, ArrayObject $options ) : void |
$event |
Cake\Event\Event |
|
$entity |
Cake\ORM\Entity |
|
$options |
ArrayObject |
|
Результат |
void |
|
initialize()
публичный Метод
processItems()
публичный Метод
Decodes the fields of an array/entity (if the value itself was encoded)
Описание свойств
$_defaultConfig защищенное свойство
TODO: json input/ouput directly, clean
protected array $_defaultConfig |
Результат |
array |
|