OMV\Config\DataModel::addProperty |
( |
|
$path, |
|
|
|
$type, |
|
|
array |
$schema = array() |
|
) |
| |
Add a new property to the model.
- Parameters
-
path | The path of the property, e.g. "aaa.bbb.ccc". |
type | The type of the property, e.g. 'string' or 'boolean'. |
- Returns
- None.
OMV\Config\DataModel::assertPropertyExists |
( |
|
$path | ) |
|
Assert that the specified property exists.
- Parameters
-
path | The path of the property, e.g. "aaa.bbb.ccc". |
- Returns
- None.
- Exceptions
-
OMV\Config\DataModel::assertPropertyNotExists |
( |
|
$path | ) |
|
Assert that the specified property does not exist.
- Parameters
-
path | The path of the property, e.g. "aaa.bbb.ccc". |
- Returns
- None.
- Exceptions
-
OMV\Config\DataModel::convertProperty |
( |
|
$path, |
|
|
|
$value |
|
) |
| |
Convert the given value into the type which is declared in the property schema at the specified path. The original value is returned when the property type can not be processed, e.g. 'any', 'array', 'object' or 'null'.
- Parameters
-
name | The path of the property, e.g. "aaa.bbb.ccc". |
value | The value to convert. |
- Returns
- The converted value.
OMV\Config\DataModel::copyProperty |
( |
|
$path, |
|
|
|
$targetPath |
|
) |
| |
Copies a property from one item to another.
- Parameters
-
path | The path of the property, e.g. "aaa.bbb.ccc". |
targetPath | The path of the new property, e.g. "xxx.yyy.zzz". |
- Returns
- None.
OMV\Config\DataModel::getNotificationId |
( |
| ) |
|
Get the notification identifier. It is auto-generated based on the data model property named 'id': 'org.openmediavault.' + <id> The identifier can be overwritten using the property that is named 'notificationid'.
- Returns
- The notification identifier string, e.g. 'org.openmediavault.x.y.z'.
OMV\Config\DataModel::getPropertyDefault |
( |
|
$path | ) |
|
Get the default value of the specified property as defined in the schema.
- Parameters
-
path | The path of the property, e.g. "aaa.bbb.ccc". |
- Returns
- The default value as specified in the schema or by the properties type.
OMV\Config\DataModel::isPersistent |
( |
| ) |
|
Tests whether the data model instance is persistent.
- Returns
- TRUE if the data model instance is persistent. If the property is not available in the data model definition, then TRUE is assumed.
OMV\Config\DataModel::propertyExists |
( |
|
$path | ) |
|
Check if the specified property exists.
- Parameters
-
path | The path of the property, e.g. "aaa.bbb.ccc". |
- Returns
- TRUE if the property exists, otherwise FALSE.
OMV\Config\DataModel::removeProperty |
( |
|
$path | ) |
|
Add a property from the model.
- Parameters
-
path | The path of the property, e.g. "aaa.bbb.ccc". |
OMV\Config\DataModel::validate |
( |
|
$data | ) |
|
Validate the specified data against the data model.
- Parameters
-
data | The JSON data to validate. |
- Returns
- None.
- Exceptions
-
OMV\Config\DataModel::walkRecursive |
( |
|
$path, |
|
|
|
$callback, |
|
|
& |
$userData = NULL |
|
) |
| |
Apply a user function recursively to every property of the schema.
- Parameters
-
path | The path of the property, e.g. "aaa.bbb.ccc". |
callback | The callback function. |
userdata | If the optional userdata parameter is supplied, it will be passed to the callback function. |
The documentation for this class was generated from the following file: