public function queue(...$values) : bool
    {
        $count = count($values);

        if ($count !== $this->numFields) {
            throw new \InvalidArgumentException(sprintf(
                'The number of values (%u) does not match the field count (%u).',
                $count,
                $this->numFields
            ));
        }

        foreach ($values as $value) {
            $this->buffer[] = $value;
        }

        $this->bufferSize++;
        $this->totalOperations++;

        if ($this->bufferSize !== $this->operationsPerQuery) {
            return false;
        }

        $this->preparedStatement->execute($this->buffer);
        $this->affectedRows += $this->preparedStatement->rowCount();

        $this->buffer = [];
        $this->bufferSize = 0;

        return true;
    }
public function queue(...$values) : bool
    {
        $count = count($values);

        if ($count !== $this->numFields) {
            throw new \InvalidArgumentException(sprintf(
                'The number of values (%u) does not match the field count (%u).',
                $count,
                $this->numFields
            ));
        }

        foreach ($values as $value) {
            $this->buffer[] = $value;
        }

        $this->bufferSize++;
        $this->totalOperations++;

        if ($this->bufferSize !== $this->operationsPerQuery) {
            return false;
        }

        $this->preparedStatement->execute($this->buffer);
        $this->affectedRows += $this->preparedStatement->rowCount();

        $this->buffer = [];
        $this->bufferSize = 0;

        return true;
    }
public function queue ( ... $ values ) : bool { $ count = count ( $ values ) ; if ( $ count !== $ this -> numFields ) { throw new \ InvalidArgumentException ( sprintf ( 'The number of values (%u) does not match the field count (%u).' , $ count , $ this -> numFields ) ) ; } foreach ( $ values as $ value ) { $ this -> buffer [ ] = $ value ; } $ this -> bufferSize ++ ; $ this -> totalOperations ++ ; if ( $ this -> bufferSize !== $ this -> operationsPerQuery ) { return false ; } $ this -> preparedStatement -> execute ( $ this -> buffer ) ; $ this -> affectedRows += $ this -> preparedStatement -> rowCount ( ) ; $ this -> buffer = [ ] ; $ this -> bufferSize = 0 ; return true ; }
Queues an operation.

@param mixed ...$values The values to process.

@return bool Whether a batch has been synchronized with the database.
This can be used to display progress feedback.

@throws \InvalidArgumentException If the number of values does not match the field count.
Queues an operation .