Example #1
0
 public function createEvent($testKey, $variantKey, $eventKey, $participantId, $metadata = null)
 {
     $value = isset($metadata['value']) ? $metadata['value'] : null;
     $event = new Event();
     $event->setTestKey($testKey);
     $event->setVariantKey($variantKey);
     $event->setEventKey($eventKey);
     $event->setParticipantId($participantId);
     $event->setMetadata($metadata);
     $event->setValue($value);
     $event->setTimeCreated(new \DateTime());
     $this->entityManager->persist($event);
     $this->entityManager->flush();
 }