selectKey = $selectKey; $this->selectKeyParams = $params; return $this; } public function setSelectJsonbMetadata(string $jsonbMetadata, array $params = []): self { $this->jsonbMetadata = $jsonbMetadata; $this->jsonbMetadataParams = $params; return $this; } public function setSelectPertinence(string $pertinence, array $params = []): self { $this->pertinence = $pertinence; $this->pertinenceParams = $params; return $this; } public function setFromClause(string $fromClause, array $params = []): self { $this->fromClause = $fromClause; $this->fromClauseParams = $params; return $this; } public function setWhereClause(string $whereClause, array $params = []): self { $this->whereClause = $whereClause; $this->whereClauseParams = $params; return $this; } public function buildQuery(): string { return \strtr("SELECT '{key}' AS key, {metadata} AS metadata, {pertinence} AS pertinence FROM {from} WHERE {where} ", [ '{key}' => $this->selectKey, '{metadata}' => $this->jsonbMetadata, '{pertinence}' => $this->pertinence, '{from}' => $this->fromClause, '{where}' => $this->whereClause ]); } public function buildParameters(): array { return \array_merge( $this->selectKeyParams, $this->jsonbMetadataParams, $this->pertinenceParams, $this->fromClauseParams, $this->whereClauseParams ); } }