GitHub PullRequestReviewCommentEvent at 2014-03-04 08:49:00
Repository: yii2
Actor: loloroboros
Payload: {"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/comments/10246656","id":10246656,"diff_hunk":"@@ -0,0 +1,65 @@\n+<?php\n+/**\n+ * @link http://www.yiiframework.com/\n+ * @copyright Copyright (c) 2008 Yii Software LLC\n+ * @license http://www.yiiframework.com/license/\n+ */\n+\n+namespace yii\\rest;\n+\n+use Yii;\n+use yii\\data\\ActiveDataProvider;\n+\n+/**\n+ * @author Qiang Xue <qiang.xue@gmail.com>\n+ * @since 2.0\n+ */\n+class IndexAction extends Action\n+{\n+\t/**\n+\t * @var callable a PHP callable that will be called to prepare a data provider that\n+\t * should return a collection of the models. If not set, [[prepareDataProvider()]] will be used instead.\n+\t * The signature of the callable should be:\n+\t *\n+\t * ```php\n+\t * function ($action) {\n+\t *     // $action is the action object currently running\n+\t * }\n+\t * ```\n+\t *\n+\t * The callable should return an instance of [[ActiveDataProvider]].\n+\t */\n+\tpublic $prepareDataProvider;","path":"framework/rest/IndexAction.php","position":32,"original_position":32,"commit_id":"c41e389f917efe77acf1d447faad179bec45f5c5","original_commit_id":"c41e389f917efe77acf1d447faad179bec45f5c5","user":{"login":"loloroboros","id":2547585,"avatar_url":"https://avatars.githubusercontent.com/u/2547585","gravatar_id":"dadcfe31ba14436f953d885b958b81e4","url":"https://api.github.com/users/loloroboros","html_url":"https://github.com/loloroboros","followers_url":"https://api.github.com/users/loloroboros/followers","following_url":"https://api.github.com/users/loloroboros/following{/other_user}","gists_url":"https://api.github.com/users/loloroboros/gists{/gist_id}","starred_url":"https://api.github.com/users/loloroboros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loloroboros/subscriptions","organizations_url":"https://api.github.com/users/loloroboros/orgs","repos_url":"https://api.github.com/users/loloroboros/repos","events_url":"https://api.github.com/users/loloroboros/events{/privacy}","received_events_url":"https://api.github.com/users/loloroboros/received_events","type":"User","site_admin":false},"body":"You will **likely** reuse your serializers. If you embed the logic in your action you're going to duplicate code. Action is just glue between HTTP and your internal system - it has no business doing serialization on its own except in a basic \"set and forget\" way.","created_at":"2014-03-04T08:49:00Z","updated_at":"2014-03-04T08:49:00Z","html_url":"https://github.com/yiisoft/yii2/pull/2599#discussion_r10246656","pull_request_url":"https://api.github.com/repos/yiisoft/yii2/pulls/2599","_links":{"self":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/comments/10246656"},"html":{"href":"https://github.com/yiisoft/yii2/pull/2599#discussion_r10246656"},"pull_request":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/2599"}}}}