- Things to know before using ORM
- How field attributes work
- Set property type
- Set table field type
- Set table field length
- Set table field default value
- Define property field as primary field
- Set relation
- Set enumeration
- Implement custom value type
- Map property to custom field name
- Set null
- Set unsigned
- Set zerofill
- Set date on insert on update
Welcome to db.php: A full funcitional but simple PHP ORM
db.php is open source simple php orm. In difference with other php orm alternatives db.php delivers simpliest intuitive api while stays fully functional and performance optimazed. Also db.php offers ability to automatically generate and synchronize tables and databases based on class model.
db.php is called db.php because it represents just a single db.php file. The only thing you need to do for installing db.php is to include db.php. Or just require it with composer:
composer require hazardland/db:dev-master
Shortly about project
db.php is delivered under MIT license. Basically our users just clone db.php source directly from our github page or they just grab db.php file from it and in rare cases they even star our github repository which generally makes us proud. If you have questions feel free to create issue under our repo here or send us an email at firstname.lastname@example.org afterwards we wish you that db.php became everyday tool for simplifying your life and for gaining more free time in your personal life which sometimes matters.
As far as this web page was created between 3 and 5 AM we apologize for syntax errors.
Below we will give you a basic idea about db.php usage
This is how class handler is registered in db.php:
This is how handlers for all classes under namespace are registered in db.php:
This is how databases, tables and fields are created or updated for registered classes:
This is how class object is saved in db.php:
$database->save (new \user\group());
This is how class object is saved in db.php in another way:
$database->user->group->save (new \user\group());
This is how class object is loaded by id:
This is how class object is deleted by id:
This is how class object is updated:
Of course this is not all as db.php offers control on every tiny aspect. Before reading manual you can first checkout our small showcase.
Or if you are new in orm field you should start reading article about What is ORM?