Add seed batch.

@param SeedBatch $seedBatch

@return self
16387
public function addSeedBatch($seedBatch)
    {
        $this->seedBatches[] = $seedBatch;

        if (method_exists(get_class($this), 'setProducer')) {
            $seedBatch->setProducer($this);
        }

        return $this;
    }
34062
protected function createBatches()
    {
        if (count($this->queue)) {
            if ($batches = $this->divisionStrategy->createBatches($this->queue)) {
                // Convert arrays into iterators
                if (is_array($batches)) {
                    $batches = new \ArrayIterator($batches);
                }
                $this->dividedBatches[] = $batches;
            }
        }
    }
1363547
public function setDataBatchBulk(array ...$valuesStack)
    {
        foreach ($valuesStack as $valuesSet) {
            $this->getValuesSetStatement()->setInsertData($valuesSet);
        }
        
        return $this;
    }
974854
public function seed()
    {
        $this->addLastModel();

        $insertedPKs = [];

        foreach ($this->quantities as $modelClass => $quantity) {
            $attributes = [];
            $pivotRecords = [];
            $translations = [];

            $this->modelPopulators[$modelClass]->setGuessedColumnFormatters(true);

            for ($i = 0; $i < $quantity; $i++) {
                list($createdModel, $pivotTables, $currentPivotRecords, $foreignKeys) =
                    $this->modelPopulators[$modelClass]->getInsertRecords($insertedPKs);

                // If the primary key is not auto incremented, it will be among the inserted attributes.
                if ($primaryKey = $createdModel->getKey()) {
                    $insertedPKs[$modelClass][] = $primaryKey;
                }

                $attributes[] = $createdModel->getAttributes();

                if ($currentPivotRecords) {
                    $pivotRecords[] = $currentPivotRecords;
                }

                if ($createdModel->relationLoaded('translations')) {
                    // We're not gonna use \Illuminate\Support\Collection::toArray(), because the
                    // translation model could have accessors to append to its array form.
                    foreach ($createdModel->translations as $translation) {
                        $translations[$i][] = $translation->getAttributes();
                    }
                }
            }

            // SQL limits how many rows you can insert at once, so we'll chunk the records.
            foreach (array_chunk($attributes, 500) as $chunk) {
                $createdModel->insert($chunk);
            }

            if (!isset($insertedPKs[$modelClass])) {
                $insertedPKs[$modelClass] = $this->getInsertedPKs($createdModel, count($attributes));
            }

            $this->insertPivotRecords(
                $createdModel->getConnection(),
                $pivotTables,
                $pivotRecords,
                $foreignKeys,
                $insertedPKs[$modelClass]
            );

            $this->insertTranslations($createdModel, $translations, $insertedPKs[$modelClass]);
        }

        $this->forgetAddedModels();

        $this->closeDoctrineConnections();

        return $insertedPKs;
    }
195628
public function createTextBatch(Api\MtBatchTextSmsCreate $batch)
    {
        $json = Serialize::textBatch($batch);
        $result = $this->_post($this->_url('/batches'), $json);
        return Deserialize::batchResponse($result);
    }
307395
public function addFolder(string $path): self
    {
        Arr::unShift($this->folders, $path);

        return $this;
    }
757351
public function addSearch(BaseSearch $search, string $key = null): self
    {
        if ($key) {
            $this->_searches[$key] = $search;
        } else {
            $this->_searches[] = $search;
        }

        return $this;
    }
1096886
public function actionSeed()
  {
    $tx = $this->db->beginTransaction();
    try
    {
      $this->seed();
      $tx->commit();
    }
    catch (Exception $e)
    {
      throw new Exception($e->getMessage());
      $tx->rollback();
    }
  }
984971
protected function seed()
    {
        $seederFilePath = $this->getAttribute('path').'/database/seeds/DatabaseSeeder.php';

        if ($this->container['files']->exists($seederFilePath)) {
            require_once $seederFilePath;

            $namespace = $this->getAttribute('namespace').'Database\\Seeds\\DatabaseSeeder';
            $class = '\\'.ltrim($namespace, '\\');
            $seeder = new $class();

            $seeder->run();
        }
    }
757004
private function add(JWESerializer $serializer): self
    {
        $this->serializers[$serializer->name()] = $serializer;

        return $this;
    }
815565
public function set($data, $batch = false) {
        $this->data  = $data;
        $this->batch = $batch;

        return $this;
    }
1352410
public void updateBatch(V batch) {

        if (intervalCheck.check()) {
            rolling();
        }
        synchronized (this) {
            unflushed = updater.updateBatch(batch, unflushed);
        }

    }
961575
public function addRandomFunction($seed = null, BuilderInterface $query = null)
    {
        $function = [
            'random_score' => $seed ? [ 'seed' => $seed ] : new \stdClass(),
        ];

        $this->applyFilter($function, $query);

        $this->functions[] = $function;

        return $this;
    }
326447
protected function platformInsertBatchHandler(QueryBuilderCache $queryBuilderCache)
    {
        if ($queryBuilderCache->from) {
            return $this->conn->execute($queryBuilderCache, ['method' => 'insert']);
        }

        return false;
    }
265100
public static function generate($seedBatch)
    {
        if (!$seedFarm = $seedBatch->getSeedFarm()) {
            throw new InvalidEntityCodeException('librinfo.error.missing_seed_farm');
        }
        if (!$seedFarmCode = $seedFarm->getCode()) {
            throw new InvalidEntityCodeException('librinfo.error.missing_seed_farm_code');
        }
        $variety = $seedBatch->getVariety();
        if (!$variety) {
            throw new InvalidEntityCodeException('librinfo.error.missing_variety');
        }
        if (!$varietyCode = $variety->getCode()) {
            throw new InvalidEntityCodeException('librinfo.error.missing_variety_code');
        }
        $species = $variety->getSpecies();
        if (!$species) {
            throw new InvalidEntityCodeException('librinfo.error.missing_species');
        }
        if (!$speciesCode = $species->getCode()) {
            throw new InvalidEntityCodeException('librinfo.error.missing_species_code');
        }
        $producer = $seedBatch->getProducer();
        if (!$producer) {
            throw new InvalidEntityCodeException('librinfo.error.missing_producer');
        }
        if (!$producerCode = $producer->getSeedProducerCode()) {
            throw new InvalidEntityCodeException('librinfo.error.missing_producer_code');
        }
        $productionYear = (int) $seedBatch->getProductionYear();
        if (!$productionYear) {
            throw new InvalidEntityCodeException('librinfo.error.missing_production_year');
        }
        // if ($productionYear < 2000 || $productionYear > 2099) {
        if ($productionYear < 1) {
            throw new InvalidEntityCodeException('librinfo.error.invalid_production_year');
        }
        // TODO: test if year is too far in the future ?

        $batchNumber = $seedBatch->getBatchNumber();
        if (!$batchNumber) {
            throw new InvalidEntityCodeException('librinfo.error.missing_batch_number');
        }
        // if ($batchNumber < 1 || $batchNumber > 99) {
        if ($batchNumber < 1) {
            throw new InvalidEntityCodeException('librinfo.error.invalid_batch_number');
        }

        return sprintf(
            '%s-%s%s-%s-%02d-%02d',
            $seedFarmCode,
            $speciesCode,
            $varietyCode,
            $producerCode,
            $productionYear % 100, // - 2000,
            $batchNumber % 100
        );
    }
981534
@Override
    public void addBatch(com.impetus.kundera.graph.Node node)
    {
        if (node != null)
        {
            nodes.add(node);
        }
        if (batchSize > 0 && batchSize == nodes.size())
        {
            executeBatch();
            nodes.clear();
        }
    }
396854
public function replaceTextBatch(
        $batchId, Api\MtBatchTextSmsCreate $batch
    ) {
        $json = Serialize::textBatch($batch);
        $result = $this->_put($this->_batchUrl($batchId), $json);
        return Deserialize::batchResponse($result);
    }