PHP code example of phyrexia / orm
1. Go to this page and download the library: Download phyrexia/orm library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phyrexia / orm example snippets
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();