Is that my model has defined the validation () method, so the controller calls create (), save (), update () and other methods before the database will automatically go validation () This method, there is no way to let him not go, Skip this method.
Reply content:
Is that my model has defined the validation () method, so the controller calls create (), save (), update () and other methods before the database will automatically go validation () This method, there is no way to let him not go, Skip this method.
1, in the expansion has been written dead, can not skip the beforevalidation, beforevalidationonxx events.
2, generally only write common data format validation there, it is not recommended to involve the validation of business logic also thrown in.
3, the best practice is that generally involves the business logic validation is directly in transaction script or domain object, aside from TS, you can not directly use the Phalcon default active record as a domain object, You also need to abstract out domain Object and finally pass repository as the façade.
Our company this is to be verified independently. The controller layer is called before the data is validated.