IMetadataQuery
in
Model that help building queries with metadata and metadata indexes
Tags
Table of Contents
Constants
- EXTRA = 'metadata'
Methods
- extractMetadata() : IFilesMetadata
- extract metadata from a result row
- getMetadataKeyField() : string
- returns the name of the field for metadata key to be used in query expressions
- getMetadataValueField() : string
- returns the name of the field for metadata string value to be used in query expressions
- joinIndex() : string
- join the metadata_index table, based on a metadataKey.
- retrieveMetadata() : void
- Add metadata linked to file id to the query
Constants
EXTRA
public
mixed
EXTRA
= 'metadata'
Tags
Methods
extractMetadata()
extract metadata from a result row
public
extractMetadata(array<string|int, mixed> $row) : IFilesMetadata
Parameters
- $row : array<string|int, mixed>
-
result row
Tags
Return values
IFilesMetadata —metadata
getMetadataKeyField()
returns the name of the field for metadata key to be used in query expressions
public
getMetadataKeyField(string $metadataKey) : string
Parameters
- $metadataKey : string
-
metadata key
Tags
Return values
string —table field
getMetadataValueField()
returns the name of the field for metadata string value to be used in query expressions
public
getMetadataValueField(string $metadataKey) : string
Note: this method loads lazy appconfig values.
Parameters
- $metadataKey : string
-
metadata key
Tags
Return values
string —table field
joinIndex()
join the metadata_index table, based on a metadataKey.
public
joinIndex(string $metadataKey[, bool $enforce = false ]) : string
This will prep the query for condition based on this specific metadataKey. If a link to the metadataKey already exists, returns known alias.
TODO: investigate how to support a search done on multiple values for same key (AND).
Parameters
- $metadataKey : string
-
metadata key
- $enforce : bool = false
-
limit the request only to existing metadata
Tags
Return values
string —generated table alias
retrieveMetadata()
Add metadata linked to file id to the query
public
retrieveMetadata() : void