|
@@ -86,7 +86,7 @@ class TimestampBehavior extends Behavior
|
|
|
* @param \Cake\Event\Event $event Event instance.
|
|
* @param \Cake\Event\Event $event Event instance.
|
|
|
* @param \Cake\Datasource\EntityInterface $entity Entity instance.
|
|
* @param \Cake\Datasource\EntityInterface $entity Entity instance.
|
|
|
* @throws \UnexpectedValueException if a field's when value is misdefined
|
|
* @throws \UnexpectedValueException if a field's when value is misdefined
|
|
|
- * @return bool Returns true irrespective of the behavior logic, the save will not be prevented.
|
|
|
|
|
|
|
+ * @return true Returns true irrespective of the behavior logic, the save will not be prevented.
|
|
|
* @throws \UnexpectedValueException When the value for an event is not 'always', 'new' or 'existing'
|
|
* @throws \UnexpectedValueException When the value for an event is not 'always', 'new' or 'existing'
|
|
|
*/
|
|
*/
|
|
|
public function handleEvent(Event $event, EntityInterface $entity)
|
|
public function handleEvent(Event $event, EntityInterface $entity)
|
|
@@ -174,7 +174,7 @@ class TimestampBehavior extends Behavior
|
|
|
$refresh = $this->_config['refreshTimestamp'];
|
|
$refresh = $this->_config['refreshTimestamp'];
|
|
|
|
|
|
|
|
foreach ($events[$eventName] as $field => $when) {
|
|
foreach ($events[$eventName] as $field => $when) {
|
|
|
- if (in_array($when, ['always', 'existing'])) {
|
|
|
|
|
|
|
+ if (in_array($when, ['always', 'existing'], true)) {
|
|
|
$return = true;
|
|
$return = true;
|
|
|
$entity->setDirty($field, false);
|
|
$entity->setDirty($field, false);
|
|
|
$this->_updateField($entity, $field, $refresh);
|
|
$this->_updateField($entity, $field, $refresh);
|