public
Description: PHP 5 library for the Vuzit AJAX document viewer web services API
Home | Edit | New

Vuzit_Event_findAll

Vuzit_Event findAll function

Retrieves a set of Vuzit document events.

Signatures

  • public static findAll(array $options)

Parameters

  • array $options : An array of options. See “Options” section.

Options

Below are the options that can be passed into the $options array.

  • event : The event type to retrieve. There are several:
    • page_view : Represents a page that has been viewed.
    • document_loaded : Represents that the document was loaded for the first time.
    • document_unloaded : Represents that the document was unloaded.
    • download_original_click : Represents that a user clicked on the “Download” link.
    • download_pdf_click: Represents that a user clicked on the “Download PDF” link.
    • zoom_in: Represents that a user zoomed in on a document.
    • zoom_out: Represents that a user zoomed out on a document.
  • value : The value type to retrieve. As a developer you can add this value as anything you like. A common use is to store information about the individual user such as their user ID.
  • id : The document web ID.
  • limit : Limits the number of results that are returned.
  • offset : The event to start retrieving events. Useful if you are paging through results. Most commonly used with the “limit” option.

Return type

  • Event : The event instance.

Usage Example

Below is a full usage example that loads up all of the pages that were viewed ("page_view) for a document of “abc123”.


Vuzit_Service::setPublicKey("YOUR_PUBLIC_API_KEY");  
Vuzit_Service::setPrivateKey("YOUR_PRIVATE_API_KEY");  

$events = Vuzit_Event::findAll("abc123", array("event" => "page_view");

foreach($events as $event)
{
  echo "Document id: " . $event->getId();
  echo "  Referer: " . $event->getReferer();
  echo "  Requested at: " . date("Y-d-m H:i:s", $event->getRequestedAt());
}

This example returns all of the events for a particular user of “jsmith” starting at the 10th event and limiting the results to 20.


$events = Vuzit_Event::findAll("abc123", array("value" => "jsmith", 
                                               "offest" => "10",
                                               "limit" => "20"));

foreach($events as $event)
{
  echo "Document id: " . $event->getId();
  echo "  Referer: " . $event->getReferer();
  echo "  Requested at: " . date("Y-d-m H:i:s", $event->getRequestedAt());
}

Last edited by bmatzelle, Fri Oct 23 13:01:46 -0700 2009
Home | Edit | New
Versions: