`data\source\Database::fields()` && `data\model\Query::fields()` refactoring #717

Merged
merged 1 commit into from Dec 11, 2012

Projects

None yet

2 participants

Contributor
jails commented Dec 9, 2012
  • Additionnal tests for data\model\Query::fields()
  • Some cleanup & more tests for #705
  • data\source\Query::fields() return flat fields array.

Note 1:

$query->fields('id');
$query->fields('id');
$query->fields('id');
...

will no no more add 'id' several times.

Note 2:

Model::find('all'); // produce a 'SELECT * ...'
Model::find('all', array('fields' => '*'); // WARNING : doesn't mean 'SELECT * ...' but 'SELECT Model.* ...'
Model::find('all', array('fields' => 'Model.*'); // same as previous, produce a 'SELECT Model.* ...'
Model::find('all', array('fields' => 'Model'); // same as previous, produce a 'SELECT Model.* ...'
Model::find('all', array('fields' => 'title'); // produce a 'SELECT Model.title ...'
Contributor
jails commented Dec 10, 2012

Refactored to avoid the BC Break.

@jails jails `data\source\Database::fields()` && `data\model\Query::fields()` refa…
…ctoring

- Additionnal tests for `data\model\Query::fields()`
- Some cleanup & more test cases for #705
a540060
@nateabele nateabele merged commit 858ffb9 into UnionOfRAD:dev Dec 11, 2012

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment