Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 753 Bytes

00_Facade.md

File metadata and controls

39 lines (26 loc) · 753 Bytes

The Rx_Facade extends the RedBean_Facade, so you can load it like so:

use Rx_Facade as R;

Currently, the two main concepts I'm adding is a R::_() function that serves as a shorthand for the most common functions (loading, dispensing etc.) and the R::$x FindHelper which extends on R::$f to cut down creation of finder queries.

A couple of examples for the _() function:

Storing a bean:

R::_( $bean );

Dispensing a bean:

$type = R::_( 'type' );

Dispense a bean and inject data:

$object = new \stdClass();
$object->name = 'name';
$object->data = 'data';

$type = R::_( 'type', $object );

(can be used to easily convert existing data into a bean)

Load a bean:

$type = R::_( 'type', $id );