In the original development of php + mysql, you need to connect to the database before operating the database, instantiate a data operation handle, and then you can query, add, and delete the data. In the windframework framework, how does one obtain an actual database operation handle? The following will be a few simple discussions on this issue. Generally, the data operations of the framework are processed by the data model layer. Taking the blog that comes with windframework as an example, the user model class of the blog is UserService. p in the original development of php + mysql, you need to connect to the database before operating the database and instantiate a data operation handle, then we can query, add, and delete data. In the windframework framework, how does one obtain an actual database operation handle? The following will be a few simple discussions on this issue.
Generally, the data operations of the framework are processed by the data model layer. The project deployment of the previous WindFramework framework has introduced the deployment of the windframework. Now, we use the blog that comes with the windframework as an example, the user model class of the blog is UserService. php, responsible for data query and Addition and other processing for the Controller IndexController. php call. Open \ blog \ service \ UserService. php and read the following code snippet:
/*** User Registration Service ** @ param UserForm $ userInfo * @ return boolean */public function register ($ userInfo) {$ db = $ this->