Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function getDefaultAttributes($user)
 {
     $attributes = parent::getDefaultAttributes($user);
     if ($user->id == $this->actor->id) {
         $attributes += ['readTime' => $user->read_time ? $user->read_time->toRFC3339String() : null, 'unreadNotificationsCount' => $user->getUnreadNotificationsCount(), 'preferences' => $user->preferences];
     }
     return $attributes;
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 protected function getDefaultAttributes($user)
 {
     $attributes = parent::getDefaultAttributes($user);
     $attributes += ['isActivated' => $user->is_activated, 'email' => $user->email, 'readTime' => $this->formatDate($user->read_time), 'unreadNotificationsCount' => (int) $user->getUnreadNotificationsCount(), 'newNotificationsCount' => (int) $user->getNewNotificationsCount(), 'preferences' => (array) $user->preferences];
     return $attributes;
 }