protected function getNestedRelations($key, $relations)
	{
		if(is_numeric($relations))
		{
			if($key == 'fields')
			{
				return $relations;
			}
			if($relations - 1 > 0)
			{
				return $relations - 1;
			}
			return [];
		}

		$nestedRelations = [];
		foreach ($relations as $prop)
		{
			if($prop === 'assets') {
				$nestedRelations[] = $prop;
				continue;
			}
			if(0 === strpos($prop, $key.'.'))
			{
				$newRelation = substr($prop, strlen($key) + 1);
				if( strlen($newRelation) !== 0)
				{
					$nestedRelations[] = $newRelation;
				}
			}
		}
		$nestedRelations = array_unique($nestedRelations);
		return $nestedRelations;
	}
protected function getNestedRelations($key, $relations)
	{
		if(is_numeric($relations))
		{
			if($key == 'fields')
			{
				return $relations;
			}
			if($relations - 1 > 0)
			{
				return $relations - 1;
			}
			return [];
		}

		$nestedRelations = [];
		foreach ($relations as $prop)
		{
			if($prop === 'assets') {
				$nestedRelations[] = $prop;
				continue;
			}
			if(0 === strpos($prop, $key.'.'))
			{
				$newRelation = substr($prop, strlen($key) + 1);
				if( strlen($newRelation) !== 0)
				{
					$nestedRelations[] = $newRelation;
				}
			}
		}
		$nestedRelations = array_unique($nestedRelations);
		return $nestedRelations;
	}
protected function getNestedRelations ( $ key , $ relations ) { if ( is_numeric ( $ relations ) ) { if ( $ key == 'fields' ) { return $ relations ; } if ( $ relations - 1 > 0 ) { return $ relations - 1 ; } return [ ] ; } $ nestedRelations = [ ] ; foreach ( $ relations as $ prop ) { if ( $ prop === 'assets' ) { $ nestedRelations [ ] = $ prop ; continue ; } if ( 0 === strpos ( $ prop , $ key . '.' ) ) { $ newRelation = substr ( $ prop , strlen ( $ key ) + 1 ) ; if ( strlen ( $ newRelation ) !== 0 ) { $ nestedRelations [ ] = $ newRelation ; } } } $ nestedRelations = array_unique ( $ nestedRelations ) ; return $ nestedRelations ; }
Get nested relations for field

@param  string	$prop
@param  array	$relations

@return boolean
Get nested relations for field