baddum / model418
A library for a simple & explicit model couch
v1.2.0
2014-11-24 16:19 UTC
Requires
- php: >=5.4.0
- symfony/yaml: ~2.5
Requires (Dev)
- c9s/sqlbuilder: 1.5.*
- codeclimate/php-test-reporter: dev-master
- michelf/php-markdown: 1.3.*
- pixel418/markdownify: 2.1.*
README
Model418 is a nice-to-use & highly flexible ORM
.
It maps your data, from a database or another source, and its relationships into accessible objects.
It could be used with or without a framework.
Features
For now, Model418 supports only the following storage:
- File System:
- Encoding: in Yaml (default), JSON, Text or Markdown
- Subfile: Write the data of an attribute in another file
- Multi folders: Use multiple folders, like plugins folder
- Session System
Let's code
// Save a new Model $user = (new UserModel) ->set('firstName', 'John') ->save(); // Retrieve all models $userList = (new UserModel)->query()->fetchAll(); count($userList) // 1 // Retrieve by primary key $john = (new UserModel)->query()->fetchById(1); // Update an existing Model $john->set('lastName', 'Doe') ->save(); // Delete an existing Model $john->delete();
To go further, you should read the complete documentation.
How to Install
This library package requires PHP 5.4
or later.
Install Composer and run the following command to get the latest version:
composer require baddum/model418:1.2.*
How to Contribute
Get involved
- Star the project!
- Report a bug that you find
- Tweet and blog about Model418 and Let me know about it.
Pull Requests
Pull requests are highly appreciated.
Please review the guidelines for contributing to go further.
Author & Community
Model418 is under MIT License.
It was created & is maintained by Thomas ZILLIOX.