-
Notifications
You must be signed in to change notification settings - Fork 6
Moldable ORM
Francesco Bianco edited this page Oct 3, 2017
·
10 revisions
To save an object in the database, you must use a model class that extends Storable
use Javanile\Moldable\Storable;
class People extends Storable
{
public $id = self::PRIMARY_KEY;
public $name = '';
}
$frank = new People();
$frank->name = 'Frank';
$frank->store();
To load objects from database, you must use a model class that extends Readable
or Storable
use Javanile\Moldable\Readable;
class People extends Readable
{
public $id = self::PRIMARY_KEY;
public $name = '';
}
$primaryKey = 1;
$frank = People::load($primaryKey)