AbstractModel
in package
AbstractYes
AbstractModel
Abstract model for PrivateBin objects.
Table of Contents
Properties
- $_conf : Configuration
- Configuration.
- $_data : array<string|int, mixed>
- Instance data.
- $_id : string
- Instance ID.
- $_store : AbstractData
- Data storage.
Methods
- __construct() : mixed
- Instance constructor.
- delete() : mixed
- Delete the current instance.
- exists() : bool
- Test if current instance exists in store.
- get() : array<string|int, mixed>
- Get instance data.
- getId() : string
- Get ID.
- isValidId() : bool
- Validate ID.
- setData() : mixed
- Set data and recalculate ID.
- setId() : mixed
- Set ID.
- store() : mixed
- Store the instance's data.
- _sanitize() : array<string|int, mixed>
- Sanitizes data to conform with current configuration.
- _validate() : mixed
- Validate data.
Properties
$_conf
Configuration.
protected
Configuration
$_conf
Tags
$_data
Instance data.
protected
array<string|int, mixed>
$_data
= array('meta' => array())
Tags
$_id
Instance ID.
protected
string
$_id
= ''
Tags
$_store
Data storage.
protected
AbstractData
$_store
Tags
Methods
__construct()
Instance constructor.
public
__construct(Configuration $configuration, AbstractData $storage) : mixed
Parameters
- $configuration : Configuration
- $storage : AbstractData
Tags
delete()
Delete the current instance.
public
abstract delete() : mixed
Tags
exists()
Test if current instance exists in store.
public
abstract exists() : bool
Tags
Return values
boolget()
Get instance data.
public
get() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getId()
Get ID.
public
getId() : string
Tags
Return values
stringisValidId()
Validate ID.
public
static isValidId(string $id) : bool
Parameters
- $id : string
Tags
Return values
boolsetData()
Set data and recalculate ID.
public
setData(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
Tags
setId()
Set ID.
public
setId(string $id) : mixed
Parameters
- $id : string
Tags
store()
Store the instance's data.
public
abstract store() : mixed
Tags
_sanitize()
Sanitizes data to conform with current configuration.
protected
abstract _sanitize(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>_validate()
Validate data.
protected
_validate(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>