MetadataReadOnly
in package
Specialized version of the Metadata class.
Supports only reading the metadata but can stream the output assuring small memory footprint.
Uses various serializers depending on the output format.
Tags
Table of Contents
Properties
- $format : string
- $id : int
- $loadFromDbParams : array<string, mixed>
- Parameters of the loadFromDb call stored for lazy initialization.
- $pdoStmnt : PDOStatement
- $pdoStmntSafe : bool
- $repo : RepoDb
- $stream : mixed
Methods
- __construct() : mixed
- freeDbConnection() : void
- getUri() : string
- lazyLoadFromDb() : void
- loadFromDb() : void
- Sets up parameters for loading the metadata from the database.
- loadFromPdoStatement() : void
- sendOutput() : void
- setFormat() : void
- generateOutput() : void
- getNamespaces() : RdfNamespaceInterface
Properties
$format
private
string
$format
$id
private
int
$id
$loadFromDbParams
Parameters of the loadFromDb call stored for lazy initialization.
private
array<string, mixed>
$loadFromDbParams
$pdoStmnt
private
PDOStatement
$pdoStmnt
$pdoStmntSafe
private
bool
$pdoStmntSafe
= false
$repo
private
RepoDb
$repo
$stream
private
mixed
$stream
Methods
__construct()
public
__construct(int $id) : mixed
Parameters
- $id : int
freeDbConnection()
public
freeDbConnection() : void
getUri()
public
getUri() : string
Return values
stringlazyLoadFromDb()
public
lazyLoadFromDb() : void
loadFromDb()
Sets up parameters for loading the metadata from the database.
public
loadFromDb(string $mode[, string|null $parentProperty = null ][, array<string|int, string> $resourceProperties = [] ][, array<string|int, string> $relativesProperties = [] ]) : void
The actual data loading happens when the lazyLoadFromDb() is called.
Parameters
- $mode : string
- $parentProperty : string|null = null
- $resourceProperties : array<string|int, string> = []
- $relativesProperties : array<string|int, string> = []
loadFromPdoStatement()
public
loadFromPdoStatement(RepoDb $repo, PDOStatement $pdoStatement[, bool $safe = false ]) : void
Parameters
- $repo : RepoDb
- $pdoStatement : PDOStatement
- $safe : bool = false
-
set to
true
if the$pdoStatement
does not require to be freed on thefreeDbConnection()
call
sendOutput()
public
sendOutput([int $triplesCacheCount = 1000 ]) : void
Parameters
- $triplesCacheCount : int = 1000
setFormat()
public
setFormat(string $format) : void
Parameters
- $format : string
generateOutput()
private
generateOutput([int $triplesCacheCount = 1000 ]) : void
Parameters
- $triplesCacheCount : int = 1000
getNamespaces()
private
getNamespaces(TriplesIterator $iter, int $triplesCacheCount) : RdfNamespaceInterface
Parameters
- $iter : TriplesIterator
- $triplesCacheCount : int