Replies: 4 comments 3 replies
-
Just check the result of the save(), if it's false that mean it failed then check errors withh getMessages : |
Beta Was this translation helpful? Give feedback.
-
Maybe this is because mysql update the fileds itself, try to use addBehavior instead. In mysql newest version you can't have multiple columns with default current_timestamp anyway, usually updated_at is nullable like : `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT NULL https://github.com/corentin-begne/phalconTool/blob/master/src/ModelBase.php#L237 |
Beta Was this translation helpful? Give feedback.
-
Didn't know it, i've got the pb when updating mysql version, so blocking, then I understood that was a bad practise. |
Beta Was this translation helpful? Give feedback.
-
I created the table below.
The following models are available for this purpose.
Then, after registering a suitable user, execute the following and you will get satisfactory results.
However, for newly created users, the results are unsatisfactory.
Wouldn't it be desirable to return an empty array after
$newUser->save()
?I think it's a problem that the behavior changes between existing records and new records.
For existing records,
dirtyState
remains0
even if the field value is changed, and for new records,getChangedFields()
does not become empty even after saving.As a result, each case needs to be checked separately.
Maybe it's because I set the fields to skip with
skipAttributes()
, but isn't that a normal thing?Is there any other way to check that a record has been saved without being confused by these situations?
Beta Was this translation helpful? Give feedback.
All reactions