JsonExtract
in package
Json Extract expression class
Tags
Table of Contents
Properties
- $rendered : string
- The rendered, dialect-specific extraction expression
Methods
- __construct() : mixed
- Constructor
- __toString() : string
- Render the expression string
- parsePathSegments() : array<string|int, mixed>
- Parse a MySQL-style JSONPath string ('$.foo.bar', '$.tags[0]') into an ordered list of path segments ('foo', 'bar' / 'tags', '0'), for dialects (PostgreSQL) that address by segment array rather than JSONPath syntax directly
Properties
$rendered
The rendered, dialect-specific extraction expression
protected
string
$rendered
Methods
__construct()
Constructor
public
__construct(AbstractSql $sql, string $column, string $path) : mixed
Instantiate the JSON extract expression object. Renders immediately - this object is immutable once built, unlike Select, whose state can still change after construction.
Parameters
- $sql : AbstractSql
- $column : string
- $path : string
Tags
__toString()
Render the expression string
public
__toString() : string
Return values
stringparsePathSegments()
Parse a MySQL-style JSONPath string ('$.foo.bar', '$.tags[0]') into an ordered list of path segments ('foo', 'bar' / 'tags', '0'), for dialects (PostgreSQL) that address by segment array rather than JSONPath syntax directly
public
static parsePathSegments(string $path) : array<string|int, mixed>
Parameters
- $path : string