public function addNamedPlaceholderValues(array $placeholderNamesToValues) : self
    {
        foreach ($placeholderNamesToValues as $placeholderName => $value) {
            if (is_array($value)) {
                if (count($value) !== 2) {
                    throw new InvalidQueryException('Incorrect number of items in value array');
                }

                $this->addNamedPlaceholderValue($placeholderName, $value[0], $value[1]);
            } else {
                $this->addNamedPlaceholderValue($placeholderName, $value);
            }
        }

        return $this;
    }
public function addNamedPlaceholderValues(array $placeholderNamesToValues) : self
    {
        foreach ($placeholderNamesToValues as $placeholderName => $value) {
            if (is_array($value)) {
                if (count($value) !== 2) {
                    throw new InvalidQueryException('Incorrect number of items in value array');
                }

                $this->addNamedPlaceholderValue($placeholderName, $value[0], $value[1]);
            } else {
                $this->addNamedPlaceholderValue($placeholderName, $value);
            }
        }

        return $this;
    }
public function addNamedPlaceholderValues ( array $ placeholderNamesToValues ) : self { foreach ( $ placeholderNamesToValues as $ placeholderName => $ value ) { if ( is_array ( $ value ) ) { if ( count ( $ value ) !== 2 ) { throw new InvalidQueryException ( 'Incorrect number of items in value array' ) ; } $ this -> addNamedPlaceholderValue ( $ placeholderName , $ value [ 0 ] , $ value [ 1 ] ) ; } else { $ this -> addNamedPlaceholderValue ( $ placeholderName , $ value ) ; } } return $ this ; }
Adds named placeholders' values
Note that you cannot use a mix of named and unnamed placeholders in a query

@param array $placeholderNamesToValues The mapping of placeholder names to their respective values
Optionally, the names can map to an array whose first item is the value and whose second value is the
PDO constant indicating the type of data the value represents
@return self For method chaining
@throws InvalidQueryException Thrown if the user mixed unnamed placeholders with named placeholders or
if the value is an array that doesn't contain the correct number of items
Adds named placeholders values Note that you cannot use a mix of named and unnamed placeholders in a query