PHP Classes
elePHPant
Icontem

MySQL Class Generator: Generate classes to access MySQL as objects

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (27)   DownloadInstall with Composer Download .zip   Reputation   Support forum (4)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-03-06 (21 days ago) RSS 2.0 feedNot enough user ratingsTotal: 136 This week: 4All time: 8,393 This week: 204Up
Version License PHP version Categories
mysqlreflection 1.0.2BSD License5PHP 5, Databases, Code Generation
Description Author

This package can perform automatic generation of PHP classes from MySQL tables.

It is able to access to a given MySQL database and retrieve schema tables and fields.

For each table it generates a class that provides methods for accessing, reading and writing its records by using object oriented programming logic.

Each generated PHP class provides Setter and Getter methods for all table fields, as well as methods for CRUD operations.

Recommendations

php class file for InnoDB having the transaction handling
Mysql Innodb connection handling in PHP

How to find package ?
I'd like find package for accessing MySQL database.

PHPeclipse - PHP - Code Templates
Generate DB class, manager and exception file like PHPeclipse

MySQL table editor
Need to be able to create an interface to edit the table data

Good and simple MySQL wrapper
What MySQL wrapper should I go with?

Best PHP mysql to mysqli or PDO solution
How to convert mysql code to use mysqli?

What is the best PHP crud class?
How to create CRUD with PHP

Access data base
Pre-written PHP MySQL functions class

Map database records to objects
Store and retrieve objects without writing native SQL again

  Performance   Level  
Name: Saro Carvello <contact>
Classes: 2 packages by
Country: Italy Italy
Age: 49
All time rank: 3734155 in Italy Italy
Week rank: 66 Up3 in Italy Italy Up

Details

MySQLReflection

A useful utility for the Object Relational Mapping of MySQL databases

This package generates PHP classes from MySQL tables. It's extracted from my PHP Web MVC Framework.

It is able to access to a given MySQL database, to retrieve from a schema tables and fields. Then, for each table, generates a class that provides methods for accessing, reading and writing its records by using object oriented programming logic.

Each auto-generated PHP class provides Setter and Getter methods for all table fields, as well as methods for CRUD operations.

An auto generated PHP class provides the following services for a MySQL table:

  • 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
  • Escaping of Strings and casting of Integers into SQL sintax for preventing SQL injection
  • Management of the Date type according to a custom localization
  • Useful PHPDOC information about table, fields and the usage of class, attributes and methods

Developers can quickly use these generated classes on their application.

Into the beans directory are located some auto generated classes of a MySQL schema.

DDL for MySQL schema is into a script file located into "sql" directory.

Overview

Overview

UML Class Model

Uml Classes Model

Convert MySQL into PHP Classes automatically - Video Tutorial

IMAGE Video Tutorial

  Files folder image Files  
File Role Description
Files folder imagebeans (9 files)
Files folder imagedocs (4 files)
Files folder imagemysqlreflection (7 files)
Files folder imagesql (1 file)
Accessible without login Plain text file app_create_beans.php Example Example script
Accessible without login Plain text file app_run_bean.php Example Example script
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file mysqlreflection.config.php Aux. Auxiliary script
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  beans  
File Role Description
  Accessible without login Plain text file bean.config.php Aux. Auxiliary script
  Plain text file BeanMultiplePk.php Class Class source
  Plain text file BeanSinglePkDate.php Class Class source
  Plain text file BeanSinglePkDateTime.php Class Class source
  Plain text file BeanSinglePkInt.php Class Class source
  Plain text file BeanSinglePkIntAuto.php Class Class source
  Plain text file BeanSinglePkString.php Class Class source
  Plain text file Model.php Class Class source
  Plain text file MySqlRecord.php Class Class source

  Files folder image Files  /  docs  
File Role Description
  Accessible without login HTML file index.html Doc. Documentation
  Accessible without login Image file MySQLReflection.png Data Auxiliary data
  Accessible without login Plain text file README.md Doc. Documentation
  Accessible without login Image file UMLClassModel.png Data Auxiliary data

  Files folder image Files  /  mysqlreflection  
File Role Description
  Plain text file MVCMySqlBeanBuilder.php Class Class source
  Plain text file MVCMySqlBeanClass.php.tpl Class Class source
  Plain text file MVCMySqlFieldToAttributeReflection.php Class Class source
  Plain text file MVCMySqlPKAnalyzer.php Class Class source
  Plain text file MVCMySqlSchemaReflection.php Class Class source
  Plain text file MVCMySqlSimpleTemplate.php Class Class source
  Plain text file MVCMySqlTableReflection.php Class Class source

  Files folder image Files  /  sql  
File Role Description
  Accessible without login Plain text file bean_db.sql Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 93%
Total:136
This week:4
All time:8,393
This week:204Up
User Comments (1)
Very useful to autogenerate PHP classes from MySQL.
1 month ago (Rossella Aiello)
87%StarStarStarStarStar