src/Koldy/Db/Query.php
public function setQuery(string $query, $bindings = null): Query
    {
        $this->query = $query;

	    if ($bindings === null) {
		    $this->bindings = new Bindings();

	    } else if (is_array($bindings)) {
		    $this->bindings = new Bindings();
		    $this->bindings->setFromArray($bindings);

	    } else if ($bindings instanceof Bindings) {
		    $this->bindings = $bindings;

	    } else {
		    throw new \InvalidArgumentException('Invalid second argument provided, expected null, array or instance of Bindings');
	    }

        return $this;
    }
public function setQuery(string $query, $bindings = null): Query
    {
        $this->query = $query;

	    if ($bindings === null) {
		    $this->bindings = new Bindings();

	    } else if (is_array($bindings)) {
		    $this->bindings = new Bindings();
		    $this->bindings->setFromArray($bindings);

	    } else if ($bindings instanceof Bindings) {
		    $this->bindings = $bindings;

	    } else {
		    throw new \InvalidArgumentException('Invalid second argument provided, expected null, array or instance of Bindings');
	    }

        return $this;
    }
public function setQuery ( string $ query , $ bindings = null ) : Query { $ this -> query = $ query ; if ( $ bindings === null ) { $ this -> bindings = new Bindings ( ) ; } else if ( is_array ( $ bindings ) ) { $ this -> bindings = new Bindings ( ) ; $ this -> bindings -> setFromArray ( $ bindings ) ; } else if ( $ bindings instanceof Bindings ) { $ this -> bindings = $ bindings ; } else { throw new \ InvalidArgumentException ( 'Invalid second argument provided, expected null, array or instance of Bindings' ) ; } return $ this ; }
Set query that will be executed

@param string $query
@param Bindings|array|null $bindings

@return Query
Set query that will be executed