public function setValues($values)
    {
        if (!$this->rows) {
            throw new \Exception('You must setRows() before setValues');
        }
        $this->values = $values;

        $valueCount = count($values);
        $fieldCount = count($this->rows);

        // Build the Placeholder String
        $placeholders = [];
        for ($i = 0; $i < $valueCount; $i++) {
            $placeholders[] = '(' . rtrim(str_repeat('?,', $fieldCount), ',') . ')';
        }
        $this->bindString = implode(',', $placeholders);

        // Build the Flat Value Array
        $valueList = [];
        foreach ($values as $value) {
            if (is_array($value)) {
                foreach ($value as $v) {
                    $valueList[] = $v;
                }
            } else {
                $valueList[] = $values;
            }
        }
        $this->valuesFlattened = $valueList;
        unset($valueList);

        return $this;
    }
public function setValues($values)
    {
        if (!$this->rows) {
            throw new \Exception('You must setRows() before setValues');
        }
        $this->values = $values;

        $valueCount = count($values);
        $fieldCount = count($this->rows);

        // Build the Placeholder String
        $placeholders = [];
        for ($i = 0; $i < $valueCount; $i++) {
            $placeholders[] = '(' . rtrim(str_repeat('?,', $fieldCount), ',') . ')';
        }
        $this->bindString = implode(',', $placeholders);

        // Build the Flat Value Array
        $valueList = [];
        foreach ($values as $value) {
            if (is_array($value)) {
                foreach ($value as $v) {
                    $valueList[] = $v;
                }
            } else {
                $valueList[] = $values;
            }
        }
        $this->valuesFlattened = $valueList;
        unset($valueList);

        return $this;
    }
public function setValues ( $ values ) { if ( ! $ this -> rows ) { throw new \ Exception ( 'You must setRows() before setValues' ) ; } $ this -> values = $ values ; $ valueCount = count ( $ values ) ; $ fieldCount = count ( $ this -> rows ) ; // Build the Placeholder String $ placeholders = [ ] ; for ( $ i = 0 ; $ i < $ valueCount ; $ i ++ ) { $ placeholders [ ] = '(' . rtrim ( str_repeat ( '?,' , $ fieldCount ) , ',' ) . ')' ; } $ this -> bindString = implode ( ',' , $ placeholders ) ; // Build the Flat Value Array $ valueList = [ ] ; foreach ( $ values as $ value ) { if ( is_array ( $ value ) ) { foreach ( $ value as $ v ) { $ valueList [ ] = $ v ; } } else { $ valueList [ ] = $ values ; } } $ this -> valuesFlattened = $ valueList ; unset ( $ valueList ) ; return $ this ; }
Set the values

@param $values array
@return object Batch
@throws \Exception
Set the values