Hi All
I have a model behavior using beforeValidationOnUpdate
that i do not understand. I have a Mysql(5.6) table
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`var` TINYINT(1) NOT NULL DEFAULT '1'
My Phalcon(3.1.1) model has the following
...
public function beforeValidationOnCreate() {
$this->var = TRUE;
}
public function beforeValidationOnUpdate() {
$this->var = TRUE;
}
...
A record is created, when I run $model->create()
. An error message var is required
, when I test $model->update()
. If i set $this->var = 1
and run $model->update()
, then the validation is passed. Can anyone explain this or is this a bug? I would expect the same validation from both create and update using $this->var = TRUE;
Thanks in advance