Пример #1
0
 /**
  * @param int[] $guids
  */
 protected function preloadCurrentUserLikes(array $guids)
 {
     $owner_guid = elgg_get_logged_in_user_guid();
     if (!$owner_guid) {
         return;
     }
     $annotation_rows = elgg_get_annotations(array('annotation_names' => 'likes', 'annotation_owner_guids' => $owner_guid, 'guids' => $guids, 'callback' => false));
     foreach ($guids as $guid) {
         $this->data->setLikedByCurrentUser($guid, false);
     }
     foreach ($annotation_rows as $row) {
         $this->data->setLikedByCurrentUser($row->entity_guid, true);
     }
 }