/WPQuery-Model

Implements an Eloquent-like model for WPQuery

Primary LanguagePHP

WPQuery-Model

Implements an Eloquent like model abstract for WPQuery

Using

Extend the Model as you see fit.

Make sure to set the Models directory:

use Apility\WPQuery\Model;

class MyModel extends Model
{
    protected $host = 'http://localhost/';
    protected $table = 'mytable';
}

Usage example

use Apility\WPQuery\Model;

class Post extends Model
{
    protected $host = 'http://localhost/';
    protected $table = 'posts';
}

$posts = Post::all();

Finding Entries

$post = Post::find(1);