Nextcloud PHP API (master)

IMetadataValueWrapper extends JsonSerializable

Model that store the value of a single metadata.

It stores the value, its type and the index status.

Tags
see
IFilesMetadata
since
28.0.0

Table of Contents

Constants

EDIT_FORBIDDEN  = 0
EDIT_REQ_OWNERSHIP  = 1
EDIT_REQ_READ_PERMISSION  = 3
EDIT_REQ_WRITE_PERMISSION  = 2
TYPE_ARRAY  = 'array'
TYPE_BOOL  = 'bool'
TYPE_FLOAT  = 'float'
TYPE_INT  = 'int'
TYPE_INT_LIST  = 'int[]'
TYPE_STRING  = 'string'
TYPE_STRING_LIST  = 'string[]'

Methods

__construct()  : mixed
Unless a call of import() to deserialize an object is expected, a valid value type is needed here.
assertType()  : self
throws an exception if the type is not correctly set
getEditPermission()  : int
get remote edit permission (Webdav PROPPATCH)
getEtag()  : string
get stored etag value
getType()  : string
returns the value type
getValueAny()  : string|int|float|bool|array<string|int, mixed>|array<string|int, string>|array<string|int, int>
get stored value
getValueArray()  : array<string|int, mixed>
get stored value
getValueBool()  : bool
get stored value
getValueFloat()  : float
get stored value
getValueInt()  : int
get stored value
getValueIntList()  : array<string|int, int>
get stored value
getValueString()  : string
get stored value
getValueStringList()  : array<string|int, string>
get stored value
import()  : self
deserialize the object from a json
isIndexed()  : bool
returns if value is an indexed value
isType()  : bool
returns if the set value type is the one expected
setEditPermission()  : self
set remote edit permission (Webdav PROPPATCH)
setEtag()  : self
set etag value
setIndexed()  : self
setValueArray()  : self
set an array value
setValueBool()  : self
set a bool value
setValueFloat()  : self
set a float value
setValueInt()  : self
set a int value
setValueIntList()  : self
set an int list value
setValueString()  : self
set a string value
setValueStringList()  : self
set a string list value

Constants

Methods

__construct()

Unless a call of import() to deserialize an object is expected, a valid value type is needed here.

public __construct(string $type) : mixed
Parameters
$type : string

value type

Tags
see
self::TYPE_INT
see
self::TYPE_FLOAT
see
self::TYPE_BOOL
see
self::TYPE_ARRAY
see
self::TYPE_STRING_LIST
see
self::TYPE_INT_LIST
see
self::TYPE_STRING
since
28.0.0

assertType()

throws an exception if the type is not correctly set

public assertType(string $type) : self
Parameters
$type : string

value type

Tags
throws
FilesMetadataTypeException

if type cannot be confirmed

see
self::TYPE_INT
see
self::TYPE_BOOL
see
self::TYPE_ARRAY
see
self::TYPE_STRING_LIST
see
self::TYPE_INT_LIST
see
self::TYPE_STRING
see
self::TYPE_FLOAT
since
28.0.0
Return values
self

getEditPermission()

get remote edit permission (Webdav PROPPATCH)

public getEditPermission() : int
Tags
since
28.0.0
Return values
int

edit permission

getEtag()

get stored etag value

public getEtag() : string
Tags
since
29.0.0
Return values
string

stored etag

getType()

returns the value type

public getType() : string
Tags
see
self::TYPE_INT
see
self::TYPE_FLOAT
see
self::TYPE_BOOL
see
self::TYPE_ARRAY
see
self::TYPE_STRING_LIST
see
self::TYPE_INT_LIST
see
self::TYPE_STRING
since
28.0.0
Return values
string

value type

getValueAny()

get stored value

public getValueAny() : string|int|float|bool|array<string|int, mixed>|array<string|int, string>|array<string|int, int>
Tags
throws
FilesMetadataNotFoundException

if value is not set

since
28.0.0
Return values
string|int|float|bool|array<string|int, mixed>|array<string|int, string>|array<string|int, int>

set value

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
see
jsonSerialize
since
28.0.0
Return values
self

isIndexed()

returns if value is an indexed value

public isIndexed() : bool
Tags
since
28.0.0
Return values
bool

TRUE if value is an indexed value

isType()

returns if the set value type is the one expected

public isType(string $type) : bool
Parameters
$type : string

value type

Tags
see
self::TYPE_INT
see
self::TYPE_FLOAT
see
self::TYPE_BOOL
see
self::TYPE_ARRAY
see
self::TYPE_STRING_LIST
see
self::TYPE_INT_LIST
see
self::TYPE_STRING
since
28.0.0
Return values
bool

setEditPermission()

set remote edit permission (Webdav PROPPATCH)

public setEditPermission(int $permission) : self
Parameters
$permission : int

edit permission

Tags
since
28.0.0
Return values
self

setEtag()

set etag value

public setEtag(string $etag) : self
Parameters
$etag : string

etag value

Tags
since
29.0.0
Return values
self

setIndexed()

public setIndexed(bool $indexed) : self
Parameters
$indexed : bool

TRUE to set the stored value as an indexed value

Tags
since
28.0.0
Return values
self

setValueArray()

set an array value

public setValueArray(array<string|int, mixed> $value) : self
Parameters
$value : array<string|int, mixed>

array to be set as value

Tags
throws
FilesMetadataTypeException

if wrapper was not set to store an array

since
28.0.0
Return values
self

setValueBool()

set a bool value

public setValueBool(bool $value) : self
Parameters
$value : bool

bool to be set as value

Tags
throws
FilesMetadataTypeException

if wrapper was not set to store a bool

since
28.0.0
Return values
self

setValueFloat()

set a float value

public setValueFloat(float $value) : self
Parameters
$value : float

float to be set as value

Tags
throws
FilesMetadataTypeException

if wrapper was not set to store a float

since
28.0.0
Return values
self

setValueInt()

set a int value

public setValueInt(int $value) : self
Parameters
$value : int

int to be set as value

Tags
throws
FilesMetadataTypeException

if wrapper was not set to store an int

since
28.0.0
Return values
self

setValueIntList()

set an int list value

public setValueIntList(array<string|int, int> $value) : self
Parameters
$value : array<string|int, int>

int list to be set as value

Tags
throws
FilesMetadataTypeException

if wrapper was not set to store an int list

since
28.0.0
Return values
self

setValueString()

set a string value

public setValueString(string $value) : self
Parameters
$value : string

string to be set as value

Tags
throws
FilesMetadataTypeException

if wrapper was not set to store a string

since
28.0.0
Return values
self

setValueStringList()

set a string list value

public setValueStringList(array<string|int, string> $value) : self
Parameters
$value : array<string|int, string>

string list to be set as value

Tags
throws
FilesMetadataTypeException

if wrapper was not set to store a string list

since
28.0.0
Return values
self

        
On this page

Search results