Skip to content
PHP class for an easy to use ORM
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
composer.json

README.md

simple-orm

PHP class for an easy to use ORM

Latest Stable Version License

Requirements

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();
You can’t perform that action at this time.