public static function fromArray(array $displayNames)
    {
        $path = new self();
        foreach ($displayNames as $v) {
            $path->push(new ResourceField(new ResourceDefinition(null), $v));
        }
        return $path;
    }
public static function fromArray(array $displayNames)
    {
        $path = new self();
        foreach ($displayNames as $v) {
            $path->push(new ResourceField(new ResourceDefinition(null), $v));
        }
        return $path;
    }
public static function fromArray ( array $ displayNames ) { $ path = new self ( ) ; foreach ( $ displayNames as $ v ) { $ path -> push ( new ResourceField ( new ResourceDefinition ( null ) , $ v ) ) ; } return $ path ; }
Only used for tests.
@param string[] $displayNames
@return array|CurrentPath
Only used for tests .