Skip to content

Allow `data\source\Database` to support a generic syntax for creating records. #740

Merged
merged 1 commit into from Dec 14, 2012

2 participants

@jails
Union of RAD member
jails commented Dec 14, 2012

Using data\source\MongoDb, the correct syntax to insert a element is:

$db = Connections::get('mongo');
$options = array(
    'type' => 'create',
    'source' => 'source',
    'data' => array(
        'data' => array(/* the datas */)
    )
);
$db->create($query);

Using data\source\Database, the correct syntax to insert a element is:

$db = Connections::get('mongo');
$options = array(
    'type' => 'create',
    'source' => 'source',
    'data' => array(/* the datas */)
);
$db->create($query);

This pull request allow the 'data' => array('data' => array(/* the datas */)) syntax for data\source\Database to allow a generic way to write queries and make data\model\Query non dependant of the datasource.

@nateabele nateabele merged commit 13aa494 into UnionOfRAD:dev Dec 14, 2012

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.