PHP code example of bmeme / eventbrite_connector

1. Go to this page and download the library: Download bmeme/eventbrite_connector library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bmeme / eventbrite_connector example snippets


 


/** @var \EventBriteConnector\Entity\Event $event */
$event = Event::create($eb, [
  'event.name.html' => 'My new awesome event',
  'event.start.utc' => '2016-10-12T14:00:00Z',
  'event.start.timezone' => 'Europe/Rome',
  'event.end.utc' => '2016-10-17T00:00:00Z',
  'event.end.timezone' => 'Europe/Rome',
  'event.currency' => 'EUR',
]);


/** @var \EventBriteConnector\Entity\Event $event */
$event->saveProperty('ticket_classes', [
  'ticket_class.name' => 'Early bird ticket',
  'ticket_class.description' => 'Special offer!',
  'ticket_class.quantity_total' => 10,
  'ticket_class.free' => TRUE
]);

 $event = $eb->fetch('event', 1234567890); 


$eb->fetch('user')
  ->load('organizers')
  ->load('owned_events', ['status' => 'live', 'order_by' => 'start_desc']);


/** @var \EventBriteConnector\Entity\Event $event */
$event->update([
  "name" => [
    'html' => 'Api updated event',
  ]
]);

 
/** @var \EventBriteConnector\Entity\Event $event */
$event->delete();


/** @var \EventBriteConnector\Entity\Media $media */
$media = new Media();
$media->setConnector($eb);
$media->upload('~/Pictures/test-image.jpg', Media::IMAGE_EVENT_LOGO, [
  'crop_mask.top_left.x' => 0,
  'crop_mask.top_left.y' => 0,
  'crop_mask.width' => 300,
  'crop_mask.height' => 200,
]);

 

$conditions = array('status' => 'live', 'order_by' => 'start_desc');

$user = $eb->fetch('user')
  ->load('organizers')
  ->load('owned_events', $conditions);
    
$event = $eb->fetch('event', 123456789)
  ->load('attendees');
    
// And now just call the getData() method!
$me = $user->getData('me');
$organizers = $user->getData('organizers');
$key = $user->buildDataKey('owned_events', $conditions);
$owned_events = $user->getData($key);

$data = array(
  'ME' => $me,
  'ORGANIZERS' => $organizers,
  'OWNED_EVENTS' => $owned_events,
  'EVENT' => $event->getData(123456789),
  'ATTENDEES' => $event->getData('attendees'),
);

// Or if you are Fast & Furious, just call the getData method without params. 
$fnf_data = $user->getData();

 

$conditions = array('status' => 'live', 'order_by' => 'start_desc');

$eb->fetch('user')
  ->load('organizers')
  ->load('owned_events', $conditions)
  ->getConnector()
  ->fetch('event', 123456789)
  ->load('attendees');
    
$data = array(
  'user' => $eb->getEntity('user', 'me')->getData(),
  'event' => $eb->getEntity('event', 123456789)->getData(),
);
 $eb = new Connector('CLIENT_SECRET', 'CLIENT_ID', 'OAUTH_TOKEN');