DAO generator for PHP and Mysql
Data Access Object: design pattern, access to data varies depending on the source of the data. Access to persistent storage, such as to a database,
varies greatly depending on the type of storage (relational databases, object-oriented databases, flat files, and so forth) and the vendor implementation.
This DAO generator generate php classes which provide operations on Mysql database.
How to generate classes
- Download latest version of DAO generator for PHP and Mysql
- unzip file
- set connection to database properties in file templates/class/dao/sql/ConnectionProperty.class.php
- run file generate.php
- generate classes will put in 'generated' folder
How does it work
Application generate three classes for one table (table must contain primary key).
First class is Domain Transfer Object, example
Second is interface that define operations on table example
Third class implements preceding interface example
How to use
- All calls through DAOFactory,
Requirements
PHP 5x
Questions, suggestions
email me at: info (at) phpdao.com
Changes
1.0 - first version
1.1 - adding possibility to get generated id of inserted row
1.2 - adding method 'clean', fixed problem in 'queryAll' method
1.3 - protecting SQL Injection
1.4 - fixed problem with values that contained char '?'
1.5 - fixed problem with null values
1.6 - fixed problem with null values
1.7 - additional methods
Tags: php Data Access Object, DAO generator for PHP and Mysql. DAOGenerator, DAO generator for PHP and Mysql, Data Access Object, php mysql object generator
Links: you can dance
Rzym