 CakePHP Cookbook Documentation 5.xthis task we can use the mapReduce() function. We need two callable functions the $mapper and the $reducer. The $mapper callable receives the current result from the database as first argument, the iteration as second argument and finally it receives an instance of the MapReduce routine it is running: $mapper = function ($article, $key, $mapReduce) { $status = 'published'; if ($article->isDraft() || 'unpublished'; } $mapReduce->emitIntermediate($article, $status); }; In the above example $mapper is calculating the status of an article, either published or unpublished, then it calls emitIntermediate()0 码力 | 1080 页 | 939.39 KB | 1 年前3 CakePHP Cookbook Documentation 5.xthis task we can use the mapReduce() function. We need two callable functions the $mapper and the $reducer. The $mapper callable receives the current result from the database as first argument, the iteration as second argument and finally it receives an instance of the MapReduce routine it is running: $mapper = function ($article, $key, $mapReduce) { $status = 'published'; if ($article->isDraft() || 'unpublished'; } $mapReduce->emitIntermediate($article, $status); }; In the above example $mapper is calculating the status of an article, either published or unpublished, then it calls emitIntermediate()0 码力 | 1080 页 | 939.39 KB | 1 年前3
 CakePHP Cookbook Documentation 5.xthis task we can use the mapReduce() function. We need two callable functions the $mapper and the $reducer. The $mapper callable receives the current result from the database as first argument, the iteration is running: 418 Chapter 12. Database Access & ORM CakePHP Cookbook Documentation, Release 5.x $mapper = function ($article, $key, $mapReduce) { $status = 'published'; if ($article->isDraft() || $ar $status = 'unpublished'; } $mapReduce->emitIntermediate($article, $status); }; In the above example $mapper is calculating the status of an article, either published or unpublished, then it calls emitIntermediate()0 码力 | 848 页 | 2.53 MB | 1 年前3 CakePHP Cookbook Documentation 5.xthis task we can use the mapReduce() function. We need two callable functions the $mapper and the $reducer. The $mapper callable receives the current result from the database as first argument, the iteration is running: 418 Chapter 12. Database Access & ORM CakePHP Cookbook Documentation, Release 5.x $mapper = function ($article, $key, $mapReduce) { $status = 'published'; if ($article->isDraft() || $ar $status = 'unpublished'; } $mapReduce->emitIntermediate($article, $status); }; In the above example $mapper is calculating the status of an article, either published or unpublished, then it calls emitIntermediate()0 码力 | 848 页 | 2.53 MB | 1 年前3
 CakePHP Cookbook 4.x
this task we can use the mapReduce() function. We need two callable functions the $mapper and the $reducer. The $mapper callable receives the current result from the database as first argument, the iteration as second argument and finally it receives an instance of the MapReduce routine it is running: $mapper = function ($article, $key, $mapReduce) { $status = 'published'; if ($article->isDraft() || 'unpublished'; } $mapReduce->emitIntermediate($article, $status); }; In the above example $mapper is calculating the status of an article, either published or unpublished, then it calls emitIntermediate()0 码力 | 1249 页 | 1.04 MB | 1 年前3 CakePHP Cookbook 4.x
this task we can use the mapReduce() function. We need two callable functions the $mapper and the $reducer. The $mapper callable receives the current result from the database as first argument, the iteration as second argument and finally it receives an instance of the MapReduce routine it is running: $mapper = function ($article, $key, $mapReduce) { $status = 'published'; if ($article->isDraft() || 'unpublished'; } $mapReduce->emitIntermediate($article, $status); }; In the above example $mapper is calculating the status of an article, either published or unpublished, then it calls emitIntermediate()0 码力 | 1249 页 | 1.04 MB | 1 年前3
 CakePHP Cookbook 3.x
this task we can use the mapReduce() function. We need two callable functions the $mapper and the $reducer. The $mapper callable receives the current result from the database as first argument, the iteration as second argument and finally it receives an instance of the MapReduce routine it is running: $mapper = function ($article, $key, $mapReduce) { $status = 'published'; if ($article->isDraft() || 'unpublished'; } $mapReduce->emitIntermediate($article, $status); }; In the above example $mapper is calculating the status of an article, either published or unpublished, then it calls emitIntermediate()0 码力 | 1244 页 | 1.05 MB | 1 年前3 CakePHP Cookbook 3.x
this task we can use the mapReduce() function. We need two callable functions the $mapper and the $reducer. The $mapper callable receives the current result from the database as first argument, the iteration as second argument and finally it receives an instance of the MapReduce routine it is running: $mapper = function ($article, $key, $mapReduce) { $status = 'published'; if ($article->isDraft() || 'unpublished'; } $mapReduce->emitIntermediate($article, $status); }; In the above example $mapper is calculating the status of an article, either published or unpublished, then it calls emitIntermediate()0 码力 | 1244 页 | 1.05 MB | 1 年前3
 CakePHP Cookbook 3.x
this task we can use the mapReduce() function. We need two callable functions the $mapper and the $reducer. The $mapper callable receives the current result from the database as first argument, the iteration as second argument and finally it receives an instance of the MapReduce routine it is running: $mapper = function ($article, $key, $mapReduce) { $status = 'published'; if ($article->isDraft() || $ar $status); }; More Information 551 CakePHP Cookbook Documentation, Release 3.10 In the above example $mapper is calculating the status of an article, either published or unpublished, then it calls emitIntermediate()0 码力 | 967 页 | 2.80 MB | 1 年前3 CakePHP Cookbook 3.x
this task we can use the mapReduce() function. We need two callable functions the $mapper and the $reducer. The $mapper callable receives the current result from the database as first argument, the iteration as second argument and finally it receives an instance of the MapReduce routine it is running: $mapper = function ($article, $key, $mapReduce) { $status = 'published'; if ($article->isDraft() || $ar $status); }; More Information 551 CakePHP Cookbook Documentation, Release 3.10 In the above example $mapper is calculating the status of an article, either published or unpublished, then it calls emitIntermediate()0 码力 | 967 页 | 2.80 MB | 1 年前3
 CakePHP Cookbook 4.x
this task we can use the mapReduce() function. We need two callable functions the $mapper and the $reducer. The $mapper callable receives the current result from the database as first argument, the iteration as second argument and finally it receives an instance of the MapReduce routine it is running: $mapper = function ($article, $key, $mapReduce) { $status = 'published'; if ($article->isDraft() || $ar $status = 'unpublished'; } $mapReduce->emitIntermediate($article, $status); }; In the above example $mapper is calculating the status of an article, either published or unpublished, then it calls emitIntermediate()0 码力 | 967 页 | 2.88 MB | 1 年前3 CakePHP Cookbook 4.x
this task we can use the mapReduce() function. We need two callable functions the $mapper and the $reducer. The $mapper callable receives the current result from the database as first argument, the iteration as second argument and finally it receives an instance of the MapReduce routine it is running: $mapper = function ($article, $key, $mapReduce) { $status = 'published'; if ($article->isDraft() || $ar $status = 'unpublished'; } $mapReduce->emitIntermediate($article, $status); }; In the above example $mapper is calculating the status of an article, either published or unpublished, then it calls emitIntermediate()0 码力 | 967 页 | 2.88 MB | 1 年前3
共 6 条
- 1














