PHP library of simple ORM

v2.0.5 2018-05-01 08:38 UTC

This package is auto-updated.

Last update: 2020-09-12 08:39:17 UTC


Latest Stable Version License

DAW PHP ORM is a Open Source PHP library of simple ORM.

Execute SQL queries with a nice syntax!


Package developed by: Développeur PHP Freelance Developpeur web Freelance

Some simple examples

You have to possibly add condition to the SQL query if some condition are === true:


$articles = Article::load()
    ->select('title', 'description', 'content')
    ->where('status', '=', 1)
    ->when(Input::hasGet('search'), function ($query) {
        return $query->where('title', 'LIKE', '%'.Input::get('search').'%');

You have the possibility to paginate automatically:


$article = new Article();

$articles = $article->where('status', '=', 1)->paginate();

echo $article->getTotal();  // int - Number of articles paginated

// Show articles
foreach ($articles as $item) {
    echo $item->title;

// Show the Pagination
echo $article->getPagination()->render();
echo $article->getPagination()->perPage();

You have the possibility to use Active Record Pattern:


$article = new Article();

You have the possibility to retrieve an element, or to return a 404 error if it does not exist:


$article = Article::load()->findOrFail($id);

You also have many other features.


  • PHP >= 7.1

If you want an accounting with PHP 7.0, you can use version 1.1: DAW PHP ORM 1.1



  • The documentation is in folder "docs" of this package:

English | French


Installation via Composer:

php composer.phar require stephweb/daw-php-orm 2.0.*


Bugs and security Vulnerabilities

If you discover a bug or a security vulnerability within DAW PHP ORM, please send a message to Stephen. Thank you. All bugs and all security vulnerabilities will be promptly addressed.


The DAW PHP ORM is Open Source software licensed under the MIT license.