That is, the validation () method has been defined in my Model. Therefore, the controller will automatically go through validation () before saving the methods such as create (), save (), and update () to the database () is there a way for him to skip this method. That is, the validation () method has been defined in my Model. Therefore, the controller will automatically go through validation () before saving the methods such as create (), save (), and update () to the database () is there a way for him to skip this method.
Reply content:
That is, the validation () method has been defined in my Model. Therefore, the controller will automatically go through validation () before saving the methods such as create (), save (), and update () to the database () is there a way for him to skip this method.
1. The events beforeValidation and beforeValidationOnXX cannot be skipped.
2. Generally, you only need to write the Common Data Format verification to it. We do not recommend that you throw the verification involving the business logic into it.
3. The best practice is that the verification that involves business logic is directly in Transaction Script or Domain Object. Aside from TS, you cannot directly use Phalcon's default Active Record as a Domain Object, you also need to abstract the Domain Object and use repository as the facade ..
Our company will verify the data only when the Controller layer calls it.