Пример #1
0
 public function postProcessing(&$data)
 {
     $data[0]['token'] = $data[1];
     $data = $data[0];
     Formatter::addStatusToUser($data);
     Formatter::addSocialServicesToUser($data);
 }
Пример #2
0
 public function postProcessing(&$data)
 {
     for ($i = 0; $i < count($data); $i++) {
         if (in_array('blogPostsCount', $this->controller->getWithParameters(\User::model(), true))) {
             $count = count(Content::model()->findAllByAttributes(array('authorId' => $data[$i]['id'], 'originService' => 'oldBlog')));
             $data[$i]['blogPostsCount'] = $count;
         }
         $favourite = Favourite::model()->byUser($this->controller->identity->getId())->byModel(get_class(\User::model()), $data[$i]['id'])->find();
         $data[$i]['is_my_favourite'] = $favourite == null ? false : true;
         Formatter::addStatusToUser($data[$i]);
     }
 }