|All requests||>||Map database records to objects||>||Request new recommendation||>||Featured requests||>||No recommendations|
by Yazan Tommalieh - 3 years ago (2015-06-21)
I would like a class that allows you to use objects to perform database operations (ORM). It should simplify database handling and data manipulation to make it much easier.
The utility generates automatically classes for any tables of a given database schema.
An auto generated MySQL class provides the following services:
A constructor for managing a fetched table’s row or for a adding a new one
Management for both single or composite Primary Keys
Automatic mapping of the different date formats may occurs between application and database Destructor to automatically close database connection
Defines a set of attributes corresponding to the table fields
Setter and Getter methods for each attribute
OO methods for simplify DML SELECT, INSERT, UPDATE and DELETE operations
A facility for quickly updating a previously fetched row
Useful methods to obtain table DDL and the last executed SQL statement
Error handling of SQL statements
Camel/Pascal case naming convention for Attributes/Class used for mapping Fields/Table
Useful PHPDOC information about table, fields and the usage of class, attributes and methods
Template based source code generation.
Caribu provides annotation based database table to php object mappings. Feel free to ask if something is unclear.
I wrote this class that builds the php code to supply basic wrappers for select, insert, update, and delete if the tables have an primary index. I use this class to build a class library for all my databases. It provides a consistent means to access your data from mysql.
Classes that are built are field, data, and query classes. The variables that represent the row columns are also type hinted so netbeans IDE can display the type and size of the field. I'm not sure if other IDE's will display it. Maybe eclipse will.
The example usage is at the bottom of the class. It is written a bit on the dirty side, but it works fast. If you have 80 tables, your code will be written in about a minute. Imagine writing all the class wrappers for 80 tables in a database.
Anyways, if you have issues using it, you can use the support option, and I'll respond.
Looks like you are trying to recommend your own package, so here it is.
There are plenty of ORM database mappers out there, is this the best one? I will let the other authors add theirs and we will see.