Skip to content

ArtemRochev/ORM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

all();
allWhere();
findById();
findOne();
save();
delete();
checkExists();

Usage:

class Post extends DatabaseRecord {
    protected $parents = ["author"];
}

Create new post:

$post = new Post;

$post->title = 'hello world';
$post->save();

Get post name by id:

$post = Post::findOne(3);

$post->title;
$post->author->name;

List of posts:

Post::all();

$user = User::findOne([
    'email' => 'jack@gmail.com'
]);
Post::allWhere([
    'author_id' => $user->id,
    'isPublished' => true
]);

Releases

No releases published

Packages

 
 
 

Languages