smeeckaert/fw-orm

ORM for FW

1.0.0.0 2015-09-20 20:04 UTC

This package is not auto-updated.

Last update: 2024-05-15 08:48:58 UTC


README

This is a lightweight standalone ORM in PHP. It was primarly made to use for simple REST APIs.

What it does

  • Uses PDO as interface
  • Provide Model helpers for CRUD
  • Provide helpers to access relations
  • Use PHPDoc as documentation
  • Based on PHP, not in configuration.

What is not supported and won't be

This library is willingly simplified.

If you want to use these features, there is plenty other ORM available that do it probably better !

  • Transactions
  • Complexes query. Queries are simple, you can't mix "OR" and "AND" in the ORM, even if you can "bypass" that.
  • Relations. While there is some support for accessing or creatin model relations, it won't be near what other ORM can provide.
  • Multiple databases.

Installation

Clone the depot and add the Orm namespace in your autoloader.

Then put database informations in your application bootstrap.

$dsn      = 'mysql:dbname=YOUR_DB;host=YOUR_HOST';
$user     = 'YOUR USER';
$password = 'YOUR_PASSWORD';
\Orm\DB::init($dsn, $user, $password);

Documentation

See the wiki

License

Everything here is public domain.