Build the structure of MySQL and the code of your PHP classes in a few clicks!

This website is intended for developers PHP / MySQL are tired of spending hours doing the same thing: create table, create classes, create getters, create setters ... A task that could be automated from simple definitions. Their precious energy should be used to reflect, discuss, imagine, and many other things. The boring work must be delegated to machines!

1) Define

2) Generate

  • Prefix for datatables :

Already 2721 generations !

3) Result

Syntaxe

Elements

Scalars

|scalar,type,"description",default|

Examples :

  • |power,int|
  • |name,string|

Type can be : bool, int, float, string, date, datetime, time

Description and default value are optional

Additional default value for date and datetime scalars : now

Limitation of int and string types : |phone,string/12|

Objects

[object,"description"]

Examples :

  • [car]
  • [person]

Description is optional

Possession

[object1: object2, |scalar,type|]

Examples :

  • [car: |power,int|]
  • [person: |name,string|]

Multiplicities

One and only one
[object1: object2]

Example : [person: car]

One or zero
[object1: ?object2]

Example : [person: ?car]

Several
[object1: *object2]

Example : [person: *car]

Multiplicity can be apply with scalars too

Special Features

Id
[object1: #object2]

Example : [house: #street, #|number,int|]

Even an object can become an id

List of elements
[object1: -object2]

Examples :

  • [school:-student]
  • [garage:-vehicle]

Objects will be usable with foreach

It can be applied with scalars too

Inheritance

[object1<-object2]

Examples :

  • [vehicle<-car]
  • [animal<-human]

Associations

Simple

[object1:{association}object2]

Example :

  • [person:{favorite}car]
  • [person:?{mother}person,?{father}person]

Correspondence

[object: ?{name,num}object, {name,num}object]

Examples :

  • [folder: ?{parent,1}folder, *{child,1}folder]
  • [member: *{sent,1}message, *{received,2}message]
    [message: {sender,1}member, {recipient,2}member]

The number identify a link between two associations

Options

(options)[object]

Examples :

  • (ct)[car]
  • (ec)[user]
  • (ze)[house]

Options can be : c (count), e (equals), s (toString), z (serialize)

Examples

Simple

(s)[dog:|name,string|]

Classic

(s)[person:|firstname,string|,|lastname,string|,-car]
(s)[car:|model,string|,|brand,string|,*person]

Advanced

(s)[member: |login,string/20|, |isAdmin,bool,,false|, |password,string/41|, *{sent,1}message, *{received,2}message]
(s)[message: {sender,1}member, {recipient,2}member, |title,string/20|, |date,datetime|, |content,string|]
[post: member, |title,string/20|, |date,datetime|, |content,string|]
(s)[post<-question: *answer]
(s)[post<-answer: question]

For more examples and explanations, go to help page.