Closed iwillhappy1314 closed 8 years ago
take a look at readme:
use \WeDevs\ORM\Eloquent\Model as Model;
class Employee extends Model {
}
var_dump( Employee::all()->toArray() ); // gets all employees
var_dump( Employee::find(1) ); // find employee with ID 1
The class name Employee
will be translated into PREFIX_employees
table to run queries. But as usual, you can override the table name.
here is more info for Eloquent: https://laravel.com/docs/5.1/eloquent
@Dreanmer thanks a lot, got it.
the example code use the default WordPress data model, is there anyway to add new model?