Added support for Model::find('all') and Model::find('view_name'), with key filters #2

Merged
merged 2 commits into from Jan 26, 2013

Conversation

Projects
None yet
2 participants
Contributor

phishy commented Jan 24, 2013

No description provided.

@gwoo gwoo commented on the diff Jan 25, 2013

extensions/data/source/Couchbase.php
@@ -109,6 +118,17 @@ public static function enabled($feature = null) {
* their respective properties in `Model`.
*/
public function configureClass($class) {
+ $pieces = explode('\\', $class);
+ $model = array_pop($pieces);
+ $source = Inflector::tableize($model);
+ $prefix = (Environment::get() == 'production') ? '' : 'dev_';
+ $this->_views[$source] = json_decode($this->getDesignDoc("{$prefix}{$source}"), true);
@gwoo

gwoo Jan 25, 2013

Owner

Will this error out if there is no doc?

@gwoo gwoo commented on the diff Jan 25, 2013

extensions/data/source/Couchbase.php
@@ -231,16 +251,40 @@ public function read($query, array $options = array()) {
))));
$key = $model::key();
- if (empty($conditions[$key])) {
- return null;
+ $viewName = '';
@gwoo

gwoo Jan 25, 2013

Owner

The data source allows for a conditions method that get's called via export. Could we move this code to that?

gwoo merged commit d6f21d3 into UnionOfRAD:master Jan 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment