ivoba/redbean-service-provider

A RedBean ORM ServiceProvider for Silex.

3.0.1 2017-02-24 08:51 UTC

This package is auto-updated.

Last update: 2024-10-10 22:05:46 UTC


README

A RedBean ORM ServiceProvider for Silex.

Build Status

Usage

  • Define a db.options array in $app with dsn, user, password and frozen entries.
    Or just pass the array while registering. see below.

  • Register the Service:

                                                                                              'dsn' => 'sqlite:/tmp/db.sqlite'
                                                                                          )));```
    
  • Init RedBean with calling $app['db'];.
    This you can do in your controller or more general.
    Then you can access your configured Facade R.

    use RedBean_Facade as R;
    ...
    $app['db'];
    ...
    $e = R::findAll('table',' ORDER BY date DESC LIMIT 2');
    

Happy tight coupling ;)