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 (37)   DownloadInstall with Composer Download .zip   Reputation   Support forum (4)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-11-07 (1 month ago) RSS 2.0 feedNot enough user ratingsTotal: 302 This week: 6All time: 7,108 This week: 116Up
Version License PHP version Categories
mysqlreflection 1.0.8BSD 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

database crud for each table
Package to analyze each table and create pdo crud for each

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

mysql database
script for update mysql database

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

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

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?

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: 50
All time rank: 3089122 in Italy Italy
Week rank: 14 Up1 in Italy Italy Up

Details

MySQLReflection

A useful utility for the Object Relation Mapping of MySQL databases

The utility generates automatically PHP classes for any tables of a given database schema.

Package is extracted from my personal PHP Web MVC Framework.

To run the utility:

1) Set your database by modifying mysqlreflection.config.php file. 2) Then just run app_create_beans.php to launch utility GUI. (Note: GUI uses Bootstrap and jQuery from CDN. So you must have internet connection alive) 3) Click "Generate Classes" button.

After running the utility you will find all generated classes into "beans" folder.

Note:

  • Auto generated classes are prefixed with "Bean".
  • Each auto generated class uses bean\bean.config.php for configuration info.
  • Each auto generated class uses Model.php and MySqlRecord.php

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.

Developers can quickly use these 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.

There is also a simple tester script "app_run_bean.php" for showing usage of a generated class.

Utility GUI

alt tag

Overview

alt tag

UML Class Model

alt tag

Convert MySQL into PHP Classes automatically - Video Tutorial (old user interface)

IMAGE ALT TEXT HERE

  Files folder image Files  
File Role Description
Files folder imagebeans (17 files)
Files folder imagedocs (6 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 BeanAclActions.php Class Class source
  Plain text file BeanDepartments.php Class Class source
  Plain text file BeanDeptEmp.php Class Class source
  Plain text file BeanDeptManager.php Class Class source
  Plain text file BeanEmployees.php Class Class source
  Plain text file BeanMultiplePk.php Class Class source
  Plain text file BeanSalaries.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 BeanTitles.php Class Class source
  Plain text file BeanUser.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 Image file gui.png Data Auxiliary data
  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 Plain text file tutorial_text.txt 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  
 92%
Total:302
This week:6
All time:7,108
This week:116Up
User Comments (1)
Very useful to autogenerate PHP classes from MySQL.
10 months ago (Rossella Aiello)
87%StarStarStarStarStar