openmediavault
4.0 (Arrakis)
The open network attached storage solution
|
Public Member Functions | |
getBackend () | |
get ($id, $uuid=NULL) | |
getAssoc ($id, $uuid=NULL) | |
getByFilter ($id, $filter, $maxResult=NULL) | |
getByFilterAssoc ($id, $filter, $maxResult=NULL) | |
set (ConfigObject &$object, $quiet=FALSE) | |
delete (ConfigObject $object, $quiet=FALSE) | |
deleteByFilter ($id, $filter, $quiet=FALSE) | |
isReferenced (ConfigObject $object) | |
assertIsReferenced (ConfigObject $object) | |
assertIsNotReferenced (ConfigObject $object) | |
exists ($id, $filter=NULL) | |
isUnique (ConfigObject $object, $property) | |
isUniqueByFilter (ConfigObject $object, $filter) | |
assertIsUnique (ConfigObject $object, $property) | |
assertIsUniqueByFilter (ConfigObject $object, $filter) | |
unlinkRevisions () | |
revert ($filename) | |
Static Public Member Functions | |
static & | getInstance () |
OMV\Config\Database::assertIsNotReferenced | ( | ConfigObject | $object | ) |
Assert that the specified configuration object is not referenced.
object | The configuration object to use. |
OMV\Config\Database::assertIsReferenced | ( | ConfigObject | $object | ) |
Assert that the specified configuration object is referenced.
object | The configuration object to use. |
OMV\Config\Database::assertIsUnique | ( | ConfigObject | $object, |
$property | |||
) |
Assert that a configuration object with the value of the specified property is unique.
object | The configuration object to use. |
property | The name of the data model property. |
OMV\Config\Database::assertIsUniqueByFilter | ( | ConfigObject | $object, |
$filter | |||
) |
Assert that a configuration object with the specified constraints is unique.
object | The configuration object to use. |
filter | A filter specifying constraints on the objects to check. |
OMV\Config\Database::delete | ( | ConfigObject | $object, |
$quiet = FALSE |
|||
) |
Delete the specified configuration object.
object | The configuration object to use. |
quiet | If set to TRUE, then no notification message is send. Defaults to FALSE. |
OMV\Config\Database::deleteByFilter | ( | $id, | |
$filter, | |||
$quiet = FALSE |
|||
) |
Delete a configuration object with the specified constraints.
id | The data model identifier. |
filter | A filter specifying constraints on the objects to retrieve. Example 1: [ "operator" => "not", "arg0" => [ "operator" => "or", "arg0" => [ "operator" => "contains", "arg0" => "opts", "arg1" => "bind" ], "arg1" => [ "operator" => "contains", "arg0" => "opts", "arg1" => "loop" ] ] ] Example 2: [ "operator" => "or", "arg0" => [ "operator" => "stringEquals", "arg0" => "devicefile", "arg1" => "/dev/sda" ], "arg1" => [ "operator" => "stringEquals", "arg0" => "devicefile", "arg1" => "/dev/disk/by-id/ata-ST1000DM003-1CH132_S2DF80PC" ] ] |
quiet | If set to TRUE, then no notification message is send. Defaults to FALSE. |
OMV\Config\Database::exists | ( | $id, | |
$filter = NULL |
|||
) |
Check if on or more configuration object of the specified data model exists.
id | The data model identifier. |
filter | A filter specifying constraints on the objects to retrieve. Defaults to NULL. Example: [ "operator": "not", "arg0": [ "operator" => "stringEquals", "arg0" => "type", "arg1" => "vlan" ] ] |
OMV\Config\Database::get | ( | $id, | |
$uuid = NULL |
|||
) |
Get the specified configuration object.
id | The data model identifier, e.g. 'conf.service.ftp'. |
uuid | The UUID of an configuration object. Defaults to NULL. |
OMV\Config\Database::getBackend | ( | ) |
Get the object that implements the database backend.
OMV\Config\Database::getByFilter | ( | $id, | |
$filter, | |||
$maxResult = NULL |
|||
) |
Get the iterable configuration objects that are matching the specified constraints.
id | The data model identifier. |
filter | A filter specifying constraints on the objects to retrieve. Example 1: [ "operator" => "stringEquals", "arg0" => "fsname", "arg1" => $params['id'] ] Example 2: [ "operator": "and", "arg0": [ "operator" => "stringEquals", "arg0" => "type", "arg1" => "bond" ], "arg1": [ "operator" => "stringEquals", "arg0" => "devicename", "arg1" => "bond0" ] ] |
maxResult | The maximum number of objects that are returned. Defaults to NULL. |
|
static |
Returns the configuration database singleton.
OMV\Config\Database::isReferenced | ( | ConfigObject | $object | ) |
Check if the specified object is referenced.
object | The configuration object to use. |
OMV\Config\Database::isUnique | ( | ConfigObject | $object, |
$property | |||
) |
Check if a configuration object with the value of the specified property is unique.
object | The configuration object to use. |
property | The name of the data model property. |
OMV\Config\Database::isUniqueByFilter | ( | ConfigObject | $object, |
$filter | |||
) |
Check if a configuration object with the specified constraints is unique.
object | The configuration object to use. |
filter | A filter specifying constraints on the objects to retrieve. Example: [ "operator" => "stringEquals", "arg0" => "sharename", "arg1" => "Movies" ] |
OMV\Config\Database::revert | ( | $filename | ) |
Revert changes. All existing revision files will be deleted.
filename | The revision file. Defaults to NONE. |
OMV\Config\Database::set | ( | ConfigObject & | $object, |
$quiet = FALSE |
|||
) |
Set the configuration object at the specified XPath expression. If the configuration object is iterable and identified as new, then the identifier property (in most cases 'uuid') will be generated and set automatically.
object | The configuration object to use. |
quiet | If set to TRUE, then no notification message is send. Defaults to FALSE. |
OMV\Config\Database::unlinkRevisions | ( | ) |
Unlink all revision files.