2 if (!defined('GNUSOCIAL')) { exit(1); }
5 * Collection primarily as the root of an Activity Streams doc but can be used as the value
6 * of extension properties in a variety of situations.
8 * A valid Collection object serialization MUST contain at least the url or items properties.
10 class JSONActivityCollection {
12 /* Non-negative integer specifying the total number of activities within the stream */
13 protected $totalItems;
15 /* An array containing a listing of Objects of any object type */
18 /* IRI referencing a JSON document containing the full listing of objects in the collection */
24 * @param array $items array of activity items
25 * @param string $url url of a doc list all the objs in the collection
26 * @param int $totalItems total number of items in the collection
28 function __construct(array $items=[], $url = null)
30 $this->items = empty($items) ? array() : $items;
31 $this->totalItems = count($items);
36 * Get the total number of items in the collection
38 * @return int total the total
40 public function getTotalItems()
42 $this->totalItems = count($items);
43 return $this->totalItems;