Example #1
0
 /**
  * {@inheritdoc}
  */
 public function createBatch(DispatcherInterface &$dispatcher, $name)
 {
     if ($name) {
         $this->connection->execute('INSERT INTO `' . self::BATCHES_TABLE_NAME . '` (`name`, `created_at`) VALUES (?, UTC_TIMESTAMP())', $name);
         return new MySqlBatch($dispatcher, $this->connection, $this->connection->lastInsertId(), $name);
     } else {
         throw new InvalidArgumentException('Batch name is required');
     }
 }