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 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() || $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
《Slides Dev Web》02. Introduction aux frameworks PHP
ré-écriture des URL, …) • Object Relational Mapping5 – Active Record, Table Data Gateway, Data Mapper, … • UI Patterns6 MVC for webdev Conventions • Nommage – Classes – Base de données – Fichiers0 码力 | 24 页 | 1.03 MB | 1 年前3
The Laravel Handbook
the class inclues some classes under a “Eloquent” folder. Eloquent is an ORM (object-relational mapper), a tool that basically lets us interact with a database using a (PHP, in this case) class. The0 码力 | 111 页 | 14.25 MB | 1 年前3
Laravel 3.2 Documentation$affected = DB::table('users')->delete(1); ELOQUENT ORM The Basics An ORM is an object-relational mapper, and Laravel has one that you will absolutely love to use. It is named "Eloquent" because it allows0 码力 | 139 页 | 1.13 MB | 1 年前3
共 9 条
- 1













