Created
March 13, 2012 15:07
Revisions
-
intel352 revised this gist
Mar 13, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ $category = Category::model()->find($criteria); $criteria = new Criteria; $criteria->order='updated ASC'; $criteria->addMapPhase(' function(value, keyData, arg) { if(!value["not_found"]) { var object = Riak.mapValuesJson(value)[0]; if(object.hasOwnProperty(arg.col) && object[arg.col] instanceof Array) { -
ButuzGOL revised this gist
Mar 12, 2012 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,16 +9,16 @@ $category = Category::model()->find($criteria); $criteria = new Criteria; $criteria->order='updated ASC'; $criteria->addMapPhase(' unction(value, keyData, arg) { if(!value["not_found"]) { var object = Riak.mapValuesJson(value)[0]; if(object.hasOwnProperty(arg.col) && object[arg.col] instanceof Array) { if(object[arg.col].indexOf(arg.val) != -1) return [[value.bucket,value.key]]; } } return []; } ', array('arg' => array('col'=>'categories','val'=>$category->primaryKey))); $apps = App::model()->findAll($criteria); -
intel352 created this gist
Mar 7, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ <?php use \ext\activedocument\Criteria; $criteria = new Criteria; $criteria->addColumnCondition(array('slug'=>$slug)); $category = Category::model()->find($criteria); $criteria = new Criteria; $criteria->order='updated ASC'; $criteria->addMapPhase(' function(value,args) { if(!value["not_found"]) { var object = Riak.mapValuesJson(value)[0]; if(object.hasOwnProperty(args.col) && object[args.col] instanceof Array) { if(args.val in object[args.col]) return [[value.bucket,value.key]]; } } return []; } ', array('col'=>'categories','val'=>$category->primaryKey)); $apps = App::model()->findAll($criteria);