MDB2_DataContainer 2 0.5.3
A persistence layer encapsulates the behaviour needed to make objects persistent. Meaning to load, save and delete objects to and from persistent storage. In this case persistent storage means relational database. Database abstraction is provided by PEAR MDB2.
With MDB2_DataContainer2 and few lines of extra code you can implement Active Record Pattern (An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data).
The class does not use any external configuration files. Extending class itself IS the configuration. All that is needed is to have matching propertyname – columname pairs in the class and the database table.
If the database schema changes, for example the developer adds a column foo to the table, all needed to do is to add a property name foo to the class which extends MDB2_DataContainer2. There is no need to rewrite any internal SQL queries.
Key Features of MDB2_DataContainer2:
- Simple API
Limitations:
- The class does not provide direct support for JOIN:s or table linking. For extreme cases it is still possible to pass hardcoded SQL queries. This usage is discouraged since it breaks the basic idea of using MDB2_DataContainer2.
More popular Database Tool
- PHP DataGrid 4.2.8 (1 year, 6 months 7 days ago)
- ajaxCRUD 5.0 (2 years, 4 months 28 days ago)
- phpMyDataGrid 2007 - AJAX Enabled Datagrid 1.0 (2 years, 4 months 28 days ago)
- XAJAX Grid 1.0 (2 years, 4 months 28 days ago)
- PHP MySQL Connection Class 1.0 (2 years, 9 months 2 days ago)
Listing Files

package.xml- 3.9 KB
- 04/08/2008 23:25:46

Inflector.php- 1.8 KB
- 04/08/2008 23:25:46

Overload.php- 1.4 KB
- 04/08/2008 23:25:46

DataContainer2.php- 15.2 KB
- 04/08/2008 23:25:46

05limit.phpt- 1.4 KB
- 04/08/2008 23:25:46

02overload.phpt- 858 Bytes
- 04/08/2008 23:25:46

11constructor.phpt- 949 Bytes
- 04/08/2008 23:25:46

07where.phpt- 779 Bytes
- 04/08/2008 23:25:46

01setproperties.phpt- 870 Bytes
- 04/08/2008 23:25:46

08delete.phpt- 945 Bytes
- 04/08/2008 23:25:46

12inflector.phpt- 1.2 KB
- 04/08/2008 23:25:46

Person.php- 2.2 KB
- 04/08/2008 23:25:46

10errormessages.phpt- 1.3 KB
- 04/08/2008 23:25:46

06order.phpt- 811 Bytes
- 04/08/2008 23:25:46

09hardcoded.phpt- 830 Bytes
- 04/08/2008 23:25:46
- FREE MySQL Cloud Database Super Simple, Zero-Management MySQL Cloud DB. Use It FREE!
- Pinterest clone Start your own pin board social network today. Get Pintastic and start your own pinterest clone network.
- MYRE Real Estate Software Professional Real Estate solutions by MYREPHP PROGRAMMING!
