4 * Collection primarily as the root of an Activity Streams doc but can be used as the value
5 * of extension properties in a variety of situations.
7 * A valid Collection object serialization MUST contain at least the url or items properties.
9 class JSONActivityCollection {
11 /* Non-negative integer specifying the total number of activities within the stream */
12 protected $totalItems;
14 /* An array containing a listing of Objects of any object type */
17 /* IRI referencing a JSON document containing the full listing of objects in the collection */
23 * @param array $items array of activity items
24 * @param string $url url of a doc list all the objs in the collection
25 * @param int $totalItems total number of items in the collection
27 function __construct($items = null, $url = null)
29 $this->items = empty($items) ? array() : $items;
30 $this->totalItems = count($items);
35 * Get the total number of items in the collection
37 * @return int total the total
39 public function getTotalItems()
41 $this->totalItems = count($items);
42 return $this->totalItems;