IFilesMetadata
extends
JsonSerializable
in
Model that represent metadata linked to a specific file.
Example of json stored in the database { "mymeta": { "value": "this is a test", "type": "string", "etag": "abcd1234", "indexed": false, "editPermission": 1 }, "myapp-anothermeta": { "value": 42, "type": "int", "etag": "0987zyxw", "indexed": true, "editPermission": 0 } }
Tags
Table of Contents
Methods
- asArray() : array<string|int, mixed>
- returns metadata in a simple array with METADATA_KEY => METADATA_VALUE
- getArray() : array<string|int, mixed>
- returns array for a metadata key
- getBool() : bool
- returns bool value for a metadata key
- getEditPermission() : int
- returns remote edit permission (Webdav PROPPATCH)
- getEtag() : string
- returns file etag stored during the last update of the metadata key
- getFileId() : int
- returns the file id linked to this metadata
- getFloat() : float
- returns float value for a metadata key
- getIndexes() : array<string|int, string>
- return the list of metadata keys set as indexed
- getInt() : int
- returns int value for a metadata key
- getIntList() : array<string|int, int>
- returns int[] value for a metadata key
- getKeys() : array<string|int, string>
- returns all current metadata keys
- getString() : string
- returns string value for a metadata key
- getStringList() : array<string|int, string>
- returns string[] value for a metadata key
- getSyncToken() : string
- returns the token known at the time the metadata were extracted from database
- getType() : string
- returns the value type of the metadata (string, int, ...)
- hasKey() : bool
- returns true if search metadata key exists
- import() : self
- deserialize the object from a json
- isIndex() : bool
- returns true if key exists and is set as indexed
- lastUpdateTimestamp() : int
- returns last time metadata were updated in the database
- removeStartsWith() : self
- unset metadata with key starting with prefix
- setArray() : self
- set a metadata key/value pair for array
- setBool() : self
- set a metadata key/value pair for bool value
- setEditPermission() : void
- set remote edit permission (Webdav PROPPATCH)
- setEtag() : void
- set file etag
- setFloat() : self
- set a metadata key/value pair for float value
- setInt() : self
- set a metadata key/value pair for int value
- setIntList() : self
- set a metadata key/value pair for list of int
- setString() : self
- set a metadata key/value pair for string value
- setStringList() : self
- set a metadata key/value pair for list of string
- unset() : self
- unset a metadata
- updated() : bool
- returns true if object have been updated since last import
Methods
asArray()
returns metadata in a simple array with METADATA_KEY => METADATA_VALUE
public
asArray() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —metadata
getArray()
returns array for a metadata key
public
getArray(string $key) : array<string|int, mixed>
Parameters
- $key : string
-
metadata key
Tags
Return values
array<string|int, mixed> —metadata value
getBool()
returns bool value for a metadata key
public
getBool(string $key) : bool
Parameters
- $key : string
-
metadata key
Tags
Return values
bool —metadata value
getEditPermission()
returns remote edit permission (Webdav PROPPATCH)
public
getEditPermission(string $key) : int
Parameters
- $key : string
-
metadata key
Tags
Return values
intgetEtag()
returns file etag stored during the last update of the metadata key
public
getEtag(string $key) : string
Parameters
- $key : string
-
metadata key
Tags
Return values
stringgetFileId()
returns the file id linked to this metadata
public
getFileId() : int
Tags
Return values
int —related file id
getFloat()
returns float value for a metadata key
public
getFloat(string $key) : float
Parameters
- $key : string
-
metadata key
Tags
Return values
float —metadata value
getIndexes()
return the list of metadata keys set as indexed
public
getIndexes() : array<string|int, string>
Tags
Return values
array<string|int, string> —list of indexes
getInt()
returns int value for a metadata key
public
getInt(string $key) : int
Parameters
- $key : string
-
metadata key
Tags
Return values
int —metadata value
getIntList()
returns int[] value for a metadata key
public
getIntList(string $key) : array<string|int, int>
Parameters
- $key : string
-
metadata key
Tags
Return values
array<string|int, int> —metadata value
getKeys()
returns all current metadata keys
public
getKeys() : array<string|int, string>
Tags
Return values
array<string|int, string> —list of keys
getString()
returns string value for a metadata key
public
getString(string $key) : string
Parameters
- $key : string
-
metadata key
Tags
Return values
string —metadata value
getStringList()
returns string[] value for a metadata key
public
getStringList(string $key) : array<string|int, string>
Parameters
- $key : string
-
metadata key
Tags
Return values
array<string|int, string> —metadata value
getSyncToken()
returns the token known at the time the metadata were extracted from database
public
getSyncToken() : string
Tags
Return values
string —token
getType()
returns the value type of the metadata (string, int, ...)
public
getType(string $key) : string
Parameters
- $key : string
-
metadata key
Tags
Return values
string —value type
hasKey()
returns true if search metadata key exists
public
hasKey(string $needle) : bool
Parameters
- $needle : string
-
metadata key to search
Tags
Return values
bool —TRUE if key exist
import()
deserialize the object from a json
public
import(array<string|int, mixed> $data) : self
Parameters
- $data : array<string|int, mixed>
-
serialized version of the object
Tags
Return values
selfisIndex()
returns true if key exists and is set as indexed
public
isIndex(string $key) : bool
Parameters
- $key : string
-
metadata key
Tags
Return values
boollastUpdateTimestamp()
returns last time metadata were updated in the database
public
lastUpdateTimestamp() : int
Tags
Return values
int —timestamp
removeStartsWith()
unset metadata with key starting with prefix
public
removeStartsWith(string $keyPrefix) : self
Parameters
- $keyPrefix : string
-
metadata key prefix
Tags
Return values
selfsetArray()
set a metadata key/value pair for array
public
setArray(string $key, array<string|int, mixed> $value) : self
Parameters
- $key : string
-
metadata key
- $value : array<string|int, mixed>
-
metadata value
Tags
Return values
selfsetBool()
set a metadata key/value pair for bool value
public
setBool(string $key, bool $value[, bool $index = false ]) : self
Parameters
- $key : string
-
metadata key
- $value : bool
-
metadata value
- $index : bool = false
-
set TRUE if value must be indexed
Tags
Return values
selfsetEditPermission()
set remote edit permission (Webdav PROPPATCH)
public
setEditPermission(string $key, int $permission) : void
Parameters
- $key : string
-
metadata key
- $permission : int
-
remote edit permission
Tags
setEtag()
set file etag
public
setEtag(string $key, string $etag) : void
Parameters
- $key : string
-
metadata key
- $etag : string
Tags
setFloat()
set a metadata key/value pair for float value
public
setFloat(string $key, float $value) : self
Parameters
- $key : string
-
metadata key
- $value : float
-
metadata value
Tags
Return values
selfsetInt()
set a metadata key/value pair for int value
public
setInt(string $key, int $value[, bool $index = false ]) : self
Parameters
- $key : string
-
metadata key
- $value : int
-
metadata value
- $index : bool = false
-
set TRUE if value must be indexed
Tags
Return values
selfsetIntList()
set a metadata key/value pair for list of int
public
setIntList(string $key, array<string|int, int> $value[, bool $index = false ]) : self
Parameters
- $key : string
-
metadata key
- $value : array<string|int, int>
-
metadata value
- $index : bool = false
-
set TRUE if each values from the list must be indexed
Tags
Return values
selfsetString()
set a metadata key/value pair for string value
public
setString(string $key, string $value[, bool $index = false ]) : self
Parameters
- $key : string
-
metadata key
- $value : string
-
metadata value
- $index : bool = false
-
set TRUE if value must be indexed
Tags
Return values
selfsetStringList()
set a metadata key/value pair for list of string
public
setStringList(string $key, array<string|int, string> $value[, bool $index = false ]) : self
Parameters
- $key : string
-
metadata key
- $value : array<string|int, string>
-
metadata value
- $index : bool = false
-
set TRUE if each values from the list must be indexed
Tags
Return values
selfunset()
unset a metadata
public
unset(string $key) : self
Parameters
- $key : string
-
metadata key
Tags
Return values
selfupdated()
returns true if object have been updated since last import
public
updated() : bool
Tags
Return values
bool —TRUE if metadata have been modified