Slide 36
Slide 36 text
ORM EXAMPLE
0) {
list($order, $limit, $offset) = $params;
}
$method = $matches[1];
return static::$method($criteria, $order, $limit, $offset);
}
public static function find($criteria = array(), $order = null, $limit = null, $offset = 0)
{
echo static::TABLE_NAME;
echo $order . ' ' . $limit . ' ' . $offset;
}
}
}
namespace App\Models {
class Posts extends \App\Model
{
const TABLE_NAME = 'posts';
}
}