public function onGetInfo(OW_Event $event) { $params = $event->getParams(); if ($params["entityType"] != self::ENTITY_TYPE) { return; } $posts = $this->service->findPostListByIds($params["entityIds"]); $out = array(); /** * @var Post $post */ foreach ($posts as $post) { $info = array(); $info["id"] = $post->id; $info["userId"] = $post->authorId; $info["title"] = $post->title; $info["description"] = $post->post; $info["url"] = $this->service->getPostUrl($post); $info["timeStamp"] = $post->timestamp; $out[$post->id] = $info; } $event->setData($out); return $out; }