We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

About model's validation

I'm reading a part of the docs ( https://docs.phalcon.io/es/latest/reference/models.html#validation-messages ), in which InvalidUpdateAttempt is an event produced when updating a non-existent record. It also happens when updating a record that will have a repeated UNIQUE that other record has? Because no clue of that in the event description (and the example code with the event shows the same message as InvalidCreateAttempt).



98.9k

It probably means the table does not have a primary key so DESCRIBE table returns the unique key as primary key



33.8k
edited Nov '14

I don't mean that, I mean creating a record in a table with an UNIQUE field that has the same value in other record (you know, duplicity).

In general, every moment of an update would be thrown in that event, isn't it?



33.8k

Yeah, I know that validator. But that means that, if I don't have the validator, every updated record that has the same unique value than other won't be thrown in an exception? (it will call the InvalidUpdatedEvent or not?).