lithium\data\model\Query::with()

public method

Set and get method for the query's embed specification.

Parameters

  • array $with

    The dotted relation paths to embed

Returns

mixed

Source

	public function with($with = []) {
		if (!func_num_args()) {
			return $this->_config['with'];
		}
		if ((!$model = $this->model()) && $with) {
			throw new ConfigException("The `'with'` option needs a valid bound model.");
		}
		$this->_config['with'] = Set::normalize($with);
		return $this;
	}