Exemple #1
0
 private function triggerNewTicketsEvent($train, $count)
 {
     $sensitivity = ['К' => [20, 36], 'П' => [25, 52], 'Л' => [10, 18], 'С1' => [30, 36], 'С2' => [50, 50]];
     $type = $train['train_type_letter'];
     if (false === isset($sensitivity[$type][0])) {
         return;
     }
     if ($count > $sensitivity[$type][0]) {
         // new tickets
         $this->store->writePoints([new Point('tickets.carriage', ceil($count / $sensitivity[$type][1]), $train['tags'])]);
     }
     $this->store->writePoints([new Point('tickets.new_tickets', $count, $train['tags'])]);
 }
Exemple #2
0
 public function storeTokenUsage()
 {
     $this->store->writePoints([new Point('tickets.token', 1)]);
 }