Nextcloud PHP API (master)

Signatory extends Entity
in package
implements JsonSerializable

model that store keys and details related to host and in use protocol mandatory details are providerId, host, keyId and public key.

private key is only used for local signatory, used to sign outgoing request

the pair providerId+host is unique, meaning only one signatory can exist for each host and protocol

Tags
since
33.0.0
psalm-suppress

PropertyNotSetInConstructor

Attributes
#[Consumable]
$since: '33.0.0'

Table of Contents

Interfaces

JsonSerializable

Properties

$id  : int
$_fieldTypes  : array<string, Types::*>
$account  : string|null
$creation  : int
$host  : string
$keyId  : string
$keyIdSum  : string
$lastUpdated  : int
$metadata  : array<string|int, mixed>|null
$privateKey  : string
$providerId  : string
$publicKey  : string
$status  : int
$type  : int
$local  : bool

Methods

__call()  : mixed
Each time a setter is called, push the part after set into an array: for instance setId will save Id in the updated fields array so it can be easily used to create the getter method
__construct()  : mixed
columnToProperty()  : string
Transform a database columnname to a property
extractIdentityFromUri()  : string
static is needed to make this easily callable from outside the model
fromParams()  : static
Simple alternative constructor for building entities from a request
fromRow()  : static
Maps the keys of the row array to the attributes
getAccount()  : string
getCreation()  : int
getFieldTypes()  : array<string, Types::*>
getHost()  : string
getId()  : int
getKeyId()  : string
getKeyIdSum()  : string
getLastUpdated()  : int
getMetadata()  : array<string|int, mixed>|null
getPrivateKey()  : string
getProviderId()  : string
getPublicKey()  : string
getSignatoryStatus()  : SignatoryStatus
getSignatoryType()  : SignatoryType
getStatus()  : int
getType()  : int
getUpdatedFields()  : array<string, true>
jsonSerialize()  : array<string|int, mixed>
propertyToColumn()  : string
Transform a property to a database column name
resetUpdatedFields()  : void
Marks the entity as clean needed for setting the id after the insertion
setAccount()  : void
setCreation()  : void
setHost()  : void
setId()  : void
setKeyId()  : void
setKeyIdSum()  : void
setLastUpdated()  : void
setMetadata()  : void
setMetaValue()  : void
update an entry in metadata
setPrivateKey()  : void
setProviderId()  : void
setPublicKey()  : void
setSignatoryStatus()  : void
setSignatoryType()  : void
setStatus()  : void
setType()  : void
slugify()  : string
Slugify the value of a given attribute Warning: This doesn't result in a unique value
addType()  : void
Adds type information for a field so that it's automatically cast to that value once its being returned from the database
getter()  : mixed
Generic getter for properties
isGetterForBoolProperty()  : bool
markFieldUpdated()  : void
Mark am attribute as updated
setter()  : void
Generic setter for properties

Properties

$_fieldTypes

protected array<string, Types::*> $_fieldTypes = ['id' => 'integer']

$account

protected string|null $account = ''

$metadata

protected array<string|int, mixed>|null $metadata = null

$privateKey

protected string $privateKey = ''

$providerId

protected string $providerId = ''

$local read-only

private bool $local = false

Methods

__call()

Each time a setter is called, push the part after set into an array: for instance setId will save Id in the updated fields array so it can be easily used to create the getter method

public __call(string $methodName, array<string|int, mixed> $args) : mixed
Parameters
$methodName : string
$args : array<string|int, mixed>
Tags
since
7.0.0

__construct()

public __construct([bool $local = false ]) : mixed
Parameters
$local : bool = false

only set to TRUE when managing local signatory

Tags
since
33.0.0

columnToProperty()

Transform a database columnname to a property

public columnToProperty(string $columnName) : string
Parameters
$columnName : string

the name of the column

Tags
since
7.0.0
Return values
string

the property name

extractIdentityFromUri()

static is needed to make this easily callable from outside the model

public static extractIdentityFromUri(string $uri) : string
Parameters
$uri : string
Tags
throws
IdentityNotFoundException

if identity cannot be extracted

since
33.0.0
Return values
string

fromParams()

Simple alternative constructor for building entities from a request

public static fromParams(array<string|int, mixed> $params) : static
Parameters
$params : array<string|int, mixed>

the array which was obtained via $this->params('key') in the controller

Tags
since
7.0.0
Return values
static

fromRow()

Maps the keys of the row array to the attributes

public static fromRow(array<string|int, mixed> $row) : static
Parameters
$row : array<string|int, mixed>

the row to map onto the entity

Tags
since
7.0.0
Return values
static

getAccount()

public getAccount() : string
Tags
since
33.0.0
Return values
string

getCreation()

public getCreation() : int
Return values
int

getFieldTypes()

public getFieldTypes() : array<string, Types::*>
Tags
since
7.0.0
Return values
array<string, Types::*>

with attribute and type

getHost()

public getHost() : string
Return values
string

getId()

public getId() : int
Return values
int

getKeyId()

public getKeyId() : string
Return values
string

getKeyIdSum()

public getKeyIdSum() : string
Return values
string

getLastUpdated()

public getLastUpdated() : int
Return values
int

getMetadata()

public getMetadata() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

getPrivateKey()

public getPrivateKey() : string
Return values
string

getProviderId()

public getProviderId() : string
Return values
string

getPublicKey()

public getPublicKey() : string
Return values
string

getStatus()

public getStatus() : int
Return values
int

getType()

public getType() : int
Return values
int

getUpdatedFields()

public getUpdatedFields() : array<string, true>
Tags
since
7.0.0
Return values
array<string, true>

array of updated fields for update query

jsonSerialize()

public jsonSerialize() : array<string|int, mixed>
Tags
since
33.0.0
Return values
array<string|int, mixed>

propertyToColumn()

Transform a property to a database column name

public propertyToColumn(string $property) : string
Parameters
$property : string

the name of the property

Tags
since
7.0.0
Return values
string

the column name

resetUpdatedFields()

Marks the entity as clean needed for setting the id after the insertion

public resetUpdatedFields() : void
Tags
since
7.0.0

setAccount()

public setAccount(string|null $account) : void
Parameters
$account : string|null

setCreation()

public setCreation(int $creation) : void
Parameters
$creation : int

setHost()

public setHost(string $host) : void
Parameters
$host : string

setId()

public setId(int $id) : void
Parameters
$id : int

setKeyId()

public setKeyId(string $keyId) : void
Parameters
$keyId : string
Tags
since
33.0.0
throws
IdentityNotFoundException

if identity cannot be extracted from keyId

setKeyIdSum()

public setKeyIdSum(string $keyIdSum) : void
Parameters
$keyIdSum : string

setLastUpdated()

public setLastUpdated(int $creation) : void
Parameters
$creation : int

setMetadata()

public setMetadata(array<string|int, mixed> $metadata) : void
Parameters
$metadata : array<string|int, mixed>

setMetaValue()

update an entry in metadata

public setMetaValue(string $key, string|int|float|bool|array<string|int, mixed> $value) : void
Parameters
$key : string
$value : string|int|float|bool|array<string|int, mixed>
Tags
since
33.0.0

setPrivateKey()

public setPrivateKey(string $privateKey) : void
Parameters
$privateKey : string

setProviderId()

public setProviderId(string $providerId) : void
Parameters
$providerId : string

setPublicKey()

public setPublicKey(string $publicKey) : void
Parameters
$publicKey : string

setStatus()

public setStatus(int $status) : void
Parameters
$status : int

setType()

public setType(int $type) : void
Parameters
$type : int

slugify()

Slugify the value of a given attribute Warning: This doesn't result in a unique value

public slugify(string $attributeName) : string
Parameters
$attributeName : string

the name of the attribute, which value should be slugified

Tags
since
7.0.0
Return values
string

slugified value

addType()

Adds type information for a field so that it's automatically cast to that value once its being returned from the database

protected addType(string $fieldName, Types::* $type) : void
Parameters
$fieldName : string

the name of the attribute

$type : Types::*

the type which will be used to match a cast

Tags
since
31.0.0

Parameter $type is now restricted to Types constants. The formerly accidentally supported types 'int'|'bool'|'double' are mapped to Types::INTEGER|Types::BOOLEAN|Types::FLOAT accordingly.

since
7.0.0

getter()

Generic getter for properties

protected getter(string $name) : mixed
Parameters
$name : string
Tags
since
7.0.0

isGetterForBoolProperty()

protected isGetterForBoolProperty(string $methodName) : bool
Parameters
$methodName : string
Tags
since
18.0.0
Return values
bool

markFieldUpdated()

Mark am attribute as updated

protected markFieldUpdated(string $attribute) : void
Parameters
$attribute : string

the name of the attribute

Tags
since
7.0.0

setter()

Generic setter for properties

protected setter(string $name, array<string|int, mixed> $args) : void
Parameters
$name : string
$args : array<string|int, mixed>
Tags
throws
InvalidArgumentException
since
7.0.0

        
On this page

Search results