Skip to main content

Overview

Namespace: FQL\Enum FiQueLa uses PHP backed enums throughout the fluent API. All enums are in the FQL\Enum namespace.

Operator

Type: string Comparison operators used in where(), and(), or(), xor(), having(), and on() calls.

Methods

evaluate(mixed $left, mixed $right): bool

Evaluate the operator against two values. Used internally by the query engine.

render(mixed $value, mixed $right): string

Render the operator and its operands as a SQL-like string.

static fromOrFail(string $operator): self

Create an Operator from a string value, throwing InvalidArgumentException for unknown operators.

Sort

Type: string Sort direction for orderBy() and sortBy().

Format

Type: string Supported data formats used when opening files or forcing a format override.

Methods

getFormatProviderClass(): class-string

Return the stream class that handles this format.

static fromExtension(string $extension): self

Resolve a Format from a file extension string. Throws InvalidFormatException for unsupported extensions.

openFile(string $path): Interface\Stream

Open a file using this format and return a stream. Throws FileNotFoundException, InvalidFormatException.

fromString(string $data): Interface\Stream

Create a stream from an in-memory string. Supported for JSON, YAML, and NEON only.

getDefaultParams(): array

Return default format parameters (e.g. encoding, delimiter for CSV).

validateParams(array $params): void

Validate that the given parameters are acceptable for this format. Throws InvalidFormatException for unsupported parameter values (e.g. a multi-character CSV delimiter or an unknown encoding).

normalizeParams(array $positional, array $named): array

Merge positional and named parameters into a single associative array for this format. Positional parameters are mapped to their corresponding named keys (e.g. for CSV, the first positional argument maps to encoding and the second to delimiter).

Join

Type: string Join type used with innerJoin(), leftJoin(), rightJoin(), and fullJoin().

Type

Type: string PHP type identifiers used with the IS / IS NOT operators and the cast() SELECT function.

Methods

static match(mixed $value): self

Detect the Type of a PHP value using gettype().

static matchByString(string $value): mixed

Parse a string representation (e.g. 'null', 'true', '42', '"hello"') and return the correctly typed PHP value.

static castValue(mixed $value, ?Type $type = null): mixed

Cast a value to the specified type. When $type is null the type is detected automatically.

static listValues(): Type[]

Return all primary (non-alias) type cases.

LogicalOperator

Type: string Logical connectors between conditions. Used internally and accessible via the where() / and() / or() / xor() fluent methods.

Methods

evaluate(?bool $left, bool $right): bool

Apply the logical operator to two boolean values. When $left is null (first condition), returns $right directly.

render(bool $spaces = false): string

Return the string value, optionally surrounded by spaces.

static casesValues(): string[]

Return all case values as a plain string array: ['AND', 'OR', 'XOR'].

LastClause

Type: string Internal enum used by the Query class to track which clause was most recently called. This powers the context-aware as() method, which aliases a SELECT field, FROM source, or JOIN depending on what was called before it.
LastClause is used internally by the query engine. You do not need to reference it directly — it enables the as() method to detect context automatically.

Fulltext

Type: string Fulltext search mode used with matchAgainst() / fulltext() in the SELECT clause.

Methods

calculate(string $fieldValue, array $terms): float

Compute a relevance score for a field value against a list of search terms. Returns a float; higher values mean more relevant. Boolean mode operators: