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
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
$id
public
int
$id
$_fieldTypes
protected
array<string, Types::*>
$_fieldTypes
= ['id' => 'integer']
$account
protected
string|null
$account
= ''
$creation
protected
int
$creation
= 0
$host
protected
string
$host
= ''
$keyId
protected
string
$keyId
= ''
$keyIdSum
protected
string
$keyIdSum
= ''
$lastUpdated
protected
int
$lastUpdated
= 0
$metadata
protected
array<string|int, mixed>|null
$metadata
= null
$privateKey
protected
string
$privateKey
= ''
$providerId
protected
string
$providerId
= ''
$publicKey
protected
string
$publicKey
= ''
$status
protected
int
$status
= 1
$type
protected
int
$type
= 9
$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
__construct()
public
__construct([bool $local = false ]) : mixed
Parameters
- $local : bool = false
-
only set to TRUE when managing local signatory
Tags
columnToProperty()
Transform a database columnname to a property
public
columnToProperty(string $columnName) : string
Parameters
- $columnName : string
-
the name of the column
Tags
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
Return values
stringfromParams()
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
Return values
staticfromRow()
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
Return values
staticgetAccount()
public
getAccount() : string
Tags
Return values
stringgetCreation()
public
getCreation() : int
Return values
intgetFieldTypes()
public
getFieldTypes() : array<string, Types::*>
Tags
Return values
array<string, Types::*> —with attribute and type
getHost()
public
getHost() : string
Return values
stringgetId()
public
getId() : int
Return values
intgetKeyId()
public
getKeyId() : string
Return values
stringgetKeyIdSum()
public
getKeyIdSum() : string
Return values
stringgetLastUpdated()
public
getLastUpdated() : int
Return values
intgetMetadata()
public
getMetadata() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetPrivateKey()
public
getPrivateKey() : string
Return values
stringgetProviderId()
public
getProviderId() : string
Return values
stringgetPublicKey()
public
getPublicKey() : string
Return values
stringgetSignatoryStatus()
public
getSignatoryStatus() : SignatoryStatus
Tags
Return values
SignatoryStatusgetSignatoryType()
public
getSignatoryType() : SignatoryType
Tags
Return values
SignatoryTypegetStatus()
public
getStatus() : int
Return values
intgetType()
public
getType() : int
Return values
intgetUpdatedFields()
public
getUpdatedFields() : array<string, true>
Tags
Return values
array<string, true> —array of updated fields for update query
jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Tags
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
Return values
string —the column name
resetUpdatedFields()
Marks the entity as clean needed for setting the id after the insertion
public
resetUpdatedFields() : void
Tags
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
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
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
setSignatoryStatus()
public
setSignatoryStatus(SignatoryStatus $status) : void
Parameters
- $status : SignatoryStatus
Tags
setSignatoryType()
public
setSignatoryType(SignatoryType $type) : void
Parameters
- $type : SignatoryType
Tags
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
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
getter()
Generic getter for properties
protected
getter(string $name) : mixed
Parameters
- $name : string
Tags
isGetterForBoolProperty()
protected
isGetterForBoolProperty(string $methodName) : bool
Parameters
- $methodName : string
Tags
Return values
boolmarkFieldUpdated()
Mark am attribute as updated
protected
markFieldUpdated(string $attribute) : void
Parameters
- $attribute : string
-
the name of the attribute
Tags
setter()
Generic setter for properties
protected
setter(string $name, array<string|int, mixed> $args) : void
Parameters
- $name : string
- $args : array<string|int, mixed>