src/mako/database/midgard/Query.php
public function including($includes)
	{
		if($includes === false)
		{
			$this->model->setIncludes([]);
		}
		else
		{
			$includes = (array) $includes;

			$currentIncludes = $this->model->getIncludes();

			if(!empty($currentIncludes))
			{
				$withCriterion = array_filter(array_keys($includes), 'is_string');

				if(!empty($withCriterion))
				{
					foreach($currentIncludes as $key => $value)
					{
						if(in_array($value, $withCriterion))
						{
							unset($currentIncludes[$key]); // Unset relations that have previously been set without a criterion closure
						}
					}
				}

				$includes = array_merge($currentIncludes, $includes);
			}

			$this->model->setIncludes(array_unique($includes, SORT_REGULAR));
		}

		return $this;
	}
public function including($includes)
	{
		if($includes === false)
		{
			$this->model->setIncludes([]);
		}
		else
		{
			$includes = (array) $includes;

			$currentIncludes = $this->model->getIncludes();

			if(!empty($currentIncludes))
			{
				$withCriterion = array_filter(array_keys($includes), 'is_string');

				if(!empty($withCriterion))
				{
					foreach($currentIncludes as $key => $value)
					{
						if(in_array($value, $withCriterion))
						{
							unset($currentIncludes[$key]); // Unset relations that have previously been set without a criterion closure
						}
					}
				}

				$includes = array_merge($currentIncludes, $includes);
			}

			$this->model->setIncludes(array_unique($includes, SORT_REGULAR));
		}

		return $this;
	}
public function including ( $ includes ) { if ( $ includes === false ) { $ this -> model -> setIncludes ( [ ] ) ; } else { $ includes = ( array ) $ includes ; $ currentIncludes = $ this -> model -> getIncludes ( ) ; if ( ! empty ( $ currentIncludes ) ) { $ withCriterion = array_filter ( array_keys ( $ includes ) , 'is_string' ) ; if ( ! empty ( $ withCriterion ) ) { foreach ( $ currentIncludes as $ key => $ value ) { if ( in_array ( $ value , $ withCriterion ) ) { unset ( $ currentIncludes [ $ key ] ) ; // Unset relations that have previously been set without a criterion closure } } } $ includes = array_merge ( $ currentIncludes , $ includes ) ; } $ this -> model -> setIncludes ( array_unique ( $ includes , SORT_REGULAR ) ) ; } return $ this ; }
Adds relations to eager load.

@param  string|array|bool $includes Relation or array of relations to eager load
@return $this
Adds relations to eager load .