Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/doomspork/modelite

models + sqlite
https://github.com/doomspork/modelite

Last synced: 6 days ago
JSON representation

models + sqlite

Awesome Lists containing this project

README

        

models + sqlite = modelite

Currently only supports PHP >= 5.3, sorry.

#roadmap
+ relationships!
+ ????
+ PROFIT!

#examples

class Posts extends Model {

$validators = array(
'title' => array('required', 'alphanumeric')
'body' => array('required')
'slug' => array(new CustomValidator()));

}

$posts = Posts::find(1) #id (sqlite's rowid)

$posts = Posts::find(array('title' => 'First Post'), array('limit' => 5));

$posts = Posts::find(array('or' => array('title' => 'First Post', 'slug' => 'second-post-slug')));