public static function queryWithAll( $config = [] ) {

		// Query Config --------

		$query			= static::find();

		$relations		= isset( $config[ 'relations' ] ) ? $config[ 'relations' ] : [];
		$conditions		= isset( $config[ 'conditions' ] ) ? $config[ 'conditions' ] : null;
		$filters		= isset( $config[ 'filters' ] ) ? $config[ 'filters' ] : null;
		$groups			= isset( $config[ 'groups' ] ) ? $config[ 'groups' ] : null;

		// Relations -----------

		$eager	= false;
		$join	= 'LEFT JOIN';

		foreach ( $relations as $relation ) {

			if( is_array( $relation ) && isset( $relation[ 'relation' ] ) ) {

				$eager	= isset( $relation[ 'eager' ] ) ? $relation[ 'eager' ] : false;
				$join	= isset( $relation[ 'join' ] ) ? $relation[ 'join' ] : 'LEFT JOIN';

				$query->joinWith( $relation[ 'relation' ], $eager, $join );
			}
			else {

				$query->joinWith( $relation );
			}
		}

		// Conditions ----------

		if( isset( $conditions ) ) {

			foreach ( $conditions as $ckey => $condition ) {

				if( is_numeric( $ckey ) ) {

					$query->andWhere( $condition );

					unset( $conditions[ $ckey ] );
				}
			}

			$query->andWhere( $conditions );
		}

		// Filters -------------

		if( isset( $filters ) ) {

			foreach ( $filters as $filter ) {

				$query = $query->andFilterWhere( $filter );
			}
		}

		// Grouping -------------

		if( isset( $groups ) ) {

			foreach ( $groups as $group ) {

				$query	= $query->groupBy( $group );
			}
		}

		$ignoreSite	= isset( $config[ 'ignoreSite' ] ) ? $config[ 'ignoreSite' ] : false;

		if( static::isMultiSite() && !$ignoreSite ) {

			$siteId	= isset( $config[ 'siteId' ] ) ? $config[ 'siteId' ] : Yii::$app->core->siteId;

			$modelTable = static::tableName();

			$query = $query->andWhere( "$modelTable.siteId=:siteId", [ ':siteId' => $siteId ] );
		}

		return $query;
	}