Firestore/src/FieldPath.php
public static function fromString($path, $splitPath = true)
    {
        self::validateString($path);

        $parts = $splitPath
            ? explode('.', $path)
            : [$path];

        return new self($parts);
    }
public static function fromString($path, $splitPath = true)
    {
        self::validateString($path);

        $parts = $splitPath
            ? explode('.', $path)
            : [$path];

        return new self($parts);
    }
public static function fromString ( $ path , $ splitPath = true ) { self :: validateString ( $ path ) ; $ parts = $ splitPath ? explode ( '.' , $ path ) : [ $ path ] ; return new self ( $ parts ) ; }
Create a FieldPath from a string path.

Example:
```
use Google\Cloud\Firestore\FieldPath;

$path = FieldPath::fromString('path.to.field');
```

@param string $path The field path string.
@param bool $splitPath If false, the input path will not be split on `.`.
**Defaults to** `true`.
@return FieldPath
@throws \InvalidArgumentException If an invalid path is provided.
Create a FieldPath from a string path .