Exemplo n.º 1
0
 /**
  * @param array $record
  *
  * @return int|bool Either the new RSVP ticket post ID or `false` on failure.
  */
 public function create_post(array $record)
 {
     $event = $this->get_event_from($record);
     $data = $this->get_ticket_data_from($record);
     $ticket_id = $this->rsvp_tickets->ticket_add($event->ID, $data);
     $ticket_name = $this->get_value_by_key($record, 'ticket_name');
     $cache_key = $ticket_name . '-' . $event->ID;
     self::$ticket_name_cache[$cache_key] = true;
     return $ticket_id;
 }
 /**
  * @param array $record
  *
  * @return int|bool Either the new RSVP ticket post ID or `false` on failure.
  */
 public function create_post(array $record)
 {
     $event = $this->get_event_from($record);
     $data = $this->get_ticket_data_from($record);
     $ticket_id = $this->rsvp_tickets->ticket_add($event->ID, $data);
     $ticket_name = $this->get_value_by_key($record, 'ticket_name');
     $cache_key = $ticket_name . '-' . $event->ID;
     self::$ticket_name_cache[$cache_key] = true;
     if ($this->is_aggregator && !empty($this->aggregator_record)) {
         $this->aggregator_record->meta['activity']->add('rsvp_tickets', 'created', $ticket_id);
     }
     return $ticket_id;
 }