phyrexia / orm
This package is abandoned and no longer maintained.
The author suggests using the doctrine/orm package instead.
PHP class for an easy to use ORM
1.5.4
2019-09-01 22:06 UTC
Requires
- php: >=5.3
- phyrexia/sql: ^1.0
Suggests
- phyrexia/cache: PHP classes for caching singletons
README
PHP class for an easy to use ORM
Requirements
- PHP >= 5.3
- Composer phyrexia/sql ^1.0
Installation
Install directly via Composer:
$ composer require phyrexia/orm
Basic Usage
<?php require 'vendor/autoload.php'; use Phyrexia\ORM\SimpleORM; class User extends SimpleORM { protected static $table = 'user'; public $id; public function __construct($id=NULL) { $this->id = $id; } } //Load User with ID 1 $user = User::load(1); //Save User $user->save(); //Delete User $user->delete(); //Check if User with ID 1 exists $exists = User::exists(1); //Load all Users $users = User::loadAll();