public function insertAll($records): int
    {
        if (!is_iterable($records)) {
            throw new TypeError(sprintf('%s() expects argument passed to be iterable, %s given', __METHOD__, gettype($records)));
        }

        $bytes = 0;
        foreach ($records as $record) {
            $bytes += $this->insertOne($record);
        }

        $this->flush_counter = 0;
        $this->document->fflush();

        return $bytes;
    }
public function insertAll($records): int
    {
        if (!is_iterable($records)) {
            throw new TypeError(sprintf('%s() expects argument passed to be iterable, %s given', __METHOD__, gettype($records)));
        }

        $bytes = 0;
        foreach ($records as $record) {
            $bytes += $this->insertOne($record);
        }

        $this->flush_counter = 0;
        $this->document->fflush();

        return $bytes;
    }
public function insertAll ( $ records ) : int { if ( ! is_iterable ( $ records ) ) { throw new TypeError ( sprintf ( '%s() expects argument passed to be iterable, %s given' , __METHOD__ , gettype ( $ records ) ) ) ; } $ bytes = 0 ; foreach ( $ records as $ record ) { $ bytes += $ this -> insertOne ( $ record ) ; } $ this -> flush_counter = 0 ; $ this -> document -> fflush ( ) ; return $ bytes ; }
Adds multiple records to the CSV document.

@see Writer::insertOne

@param Traversable|array $records
Adds multiple records to the CSV document .