BrDataSource

One of the most important components of the Bright is it's Data Source.

1. Getting started.

Bright Data Source implemented by BrDataSource class and intended to help to work with data which is stored in database. Currently Bright supports MySQL and MongoDB databases. Typical Data Source definition looks like following:

$tasks = br.dataSource('/api/tasks/');

First parameter in BrDataSource constructor is name of the table (or collection if we are talking about MongoDB).

You may also specify some additional settings:

$bookmarks = br.dataSource( '/api/bookmarks/'
                          , array( 'defaultOrder'    => 'name'
                                 , 'checkTraversing' => true
                                 )
                          );