예제 #1
0
파일: Groups.php 프로젝트: Pleio/pleio_rest
 /**
  * @SWG\Definition(
  *  definition="Group",
  *  required={"guid","name", "membership"},
  *  @SWG\Property(property="guid", type="integer"),
  *  @SWG\Property(property="name", type="string"),
  *  @SWG\Property(property="description", type="string"),
  *  @SWG\Property(property="membership", type="string", description="Can be open or closed."),
  *  @SWG\Property(property="icon_url", type="string"),
  *  @SWG\Property(property="url", type="string"),
  *  @SWG\Property(property="activities_unread_count", type="integer"),
  *  @SWG\Property(property="time_created", type="string")
  * )
  */
 private function parseGroup(\ElggGroup $group)
 {
     $user = elgg_get_logged_in_user_entity();
     return array('guid' => $group->guid, 'name' => html_entity_decode($group->name, ENT_QUOTES), 'description' => html_entity_decode($group->description, ENT_QUOTES), 'membership' => $group->membership === 2 ? "open" : "closed", 'icon_url' => $group->getIconURL(), 'url' => $group->getURL(), 'activities_unread_count' => $this->handler->getContainerUnreadCount($user, $group), 'time_created' => date('c', $group->time_created));
 }