Adds the given graphs as alternative conditions.

@param GraphBuilder|GraphBuilder[] $graphs
@return self
@throws InvalidArgumentException
488278
public function union( $graphs /* graphs ... */ ) {
		$graphs = is_array( $graphs ) ? $graphs : func_get_args();

		$this->unions[] = implode( ' UNION', array_map( function( GraphBuilder $graph ) {
			return ' {' . $graph->getSPARQL() . ' }';
		}, $graphs ) );

		return $this;
	}
838807
public function setChildren($children)
    {
        $this->clearChildren();
        foreach ($children as $child) {
            $this->addChild($child);
        }

        return $this;
    }
1142610
public function setItems($items) {

      if (!is_array($items)) {
        throw new \InvalidArgumentException('You can set only array of items');
      }

      $this->items = $items;
      $this->rewind();
      return $this;
    }
1054797
public function setAliases($aliases)
    {
        if (!is_array($aliases) && !$aliases instanceof \Traversable) {
            throw new InvalidArgumentException('$aliases must be an array or an instance of \Traversable');
        }

        foreach ($aliases as $alias) {
            $this->validateName($alias);
        }

        $this->aliases = $aliases;

        return $this;
    }
283114
public function setValues(array $values)
    {
        foreach ($values as $value) {
            if (false === is_scalar($value)) {
                throw InvalidArgumentException::create(
                    'Non-scalar values (such as %s) are not supported.',
                    gettype($value)
                );
            }
        }

        $this->values = $values;
    }
157455
public function setIndices( $indices )
	{
		foreach( $indices as $index )
		{
			if( !in_array( $index, $this->columns ) )
				throw new \InvalidArgumentException( 'Column "'.$index.'" is not existing in table "'.$this->tableName.'" and cannot be an index' );
			if( $index === $this->primaryKey )
				throw new \InvalidArgumentException( 'Column "'.$index.'" is already primary key and cannot be an index' );
		}
		$this->indices	= $indices;
		array_unique( $this->indices );
	}
1273952
public function addConditions( $conditions )
	{
		if( !is_array( $conditions ) )
			throw new InvalidArgumentException( 'An Array should be given.' );
		foreach( $conditions as $condition )
			$this->addCondition( $condition );
	}
746955
public function addConditionsFromArray(array $conditions)
    {
        foreach ($conditions as $condition) {

            if (!is_callable($condition)) {

                $message = "One or more of the conditions you provided are not callable, ";
                $message .= "please pass an array of callable functions.";

                throw new \InvalidArgumentException($message);
            }

            $this->conditions->enqueue($condition);

        }
    }
507949
public function addChildren(array $children)
    {
        if ($this->isVoid) {
            throw new Exception\RuntimeException(
                'Void elements can\'t have child elements.'
            );
        }

        foreach ($children as $child) {
            $this->addChild($child);
        }

        return $this;
    }
1299236
public function removeQueries(array $queries) : self
    {
        foreach ($queries as $key) {
            if (!is_string($key)) {
                throw new \InvalidArgumentException("Invalid querystring '" . $key . "'");
            }

            if (isset($this->uri['query'][$key])) {
                unset($this->uri['query'][$key]);
            }
        }

        return $this;
    }
1159320
public function addTabs( $tabs = array() )
	{
		if( !is_array( $tabs ) )
			throw new InvalidArgumentException( 'Tabs must be given as array of labels and contents.' );
		foreach( $tabs as $label => $content )
			$this->addTab( $label, $content );
	}
824915
public function fields($fields)
    {
        if (!is_array($fields)) {
            $fields = func_get_args();
        }

        $this->graphNode->fields($fields);

        return $this;
    }
829983
public function setRoutes(array $routes) {

	    foreach($routes as $route) {

	        if(!$route instanceof Route) {
	            throw new \InvalidArgumentException(sprintf("'%s' is not a Route instance.", $route));
            }

            $this->addRoute($route);

        }

    }
739766
public function columns($columns)
    {
        if( is_array($columns) ||
            is_string($columns) ||
            $columns instanceof Expression ) {
            $this->columns = $columns;
        } else {
            throw new InvalidArgumentException('Invalid columns parameter');
        }
        return $this;
    }
1223936
public function addHeader($headers)
    {
        foreach ((array) $headers as $header) {
            if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) {
                throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons');
            }
            $this->headers[] = $header;
        }

        return $this;
    }
75398
public function add($collection)
    {
        if (!is_array($collection) and !($collection instanceof \Traversable)) {
            throw new \InvalidArgumentException(self::MSG_NOT_ITERABLE, 230);
        }
        
        foreach ($collection as $name => $closure) {
            $this->set($name, $closure);
        }
        
        return $this;
    }
1275462
public function references($references)
    {
        if (null !== $references && !is_array($references)) {
            throw new \InvalidArgumentException(sprintf('The references "%s" are not valid.', $references));
        }

        $this->references = $references;

        return $this;
    }