Пример #1
0
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once 'vendor/autoload.php';
use Citrix\Citrix;
use Citrix\GoToWebinar;
use Citrix\Entity\Consumer;
//authenticate
$client = new Citrix('CONSUMER_KEY');
$client->auth('USERNAME', 'PASSWORD');
//get upcoming weibnars
$goToWebinar = new GoToWebinar($client);
$webinars = $goToWebinar->getUpcoming();
//get info for a single webinar
/* @var $webinar Citrix\Enttiy\Webinar */
$webinar = reset($webinars);
//get registraion/join url
$registrationUrl = $webinar->getRegistrationUrl();
//get more info about a webinar
$webinarInfo = $goToWebinar->getWebinar($webinar->getId());
//get registrants for given webinar
$registrants = $webinar->getRegistrants();
//register a user for a webinar
$data = array('email' => '*****@*****.**', 'firstName' => 'Teodor', 'lastName' => 'Talov');
$consumer = new Consumer($client);
$consumer->setData($data)->populate();
$registration = $webinar->registerConsumer($consumer);
if ($registration->hasErrors()) {
    throw new \Exception($registration->getError());
}
var_dump('You just registered!');
Пример #2
0
 public function getTransientWebinar($trasient_key, $webinar_id)
 {
     $webinar = get_transient($trasient_key);
     if (false === $webinar) {
         $goToWebinar = new GoToWebinar($this->client);
         $webinar = $goToWebinar->getWebinar($webinar_id);
         set_transient($trasient_key, $webinar, DAY_IN_SECONDS);
     }
     return $webinar;
 }