openmediavault  4.0 (Arrakis)
The open network attached storage solution
Public Member Functions | Protected Member Functions | List of all members
OMV\Config\DatabaseBackendQueryBuilder Class Reference

Public Member Functions

 __construct ($model)
 
 buildPredicate ($filter)
 
 buildQueryByFilter ($filter)
 
 buildGetQuery ($idValue=NULL)
 
 buildSetQuery (ConfigObject $object)
 
 buildDeleteQuery (ConfigObject $object)
 
 buildIsReferencedQuery (ConfigObject $object)
 
 buildExistsQuery ($filter=NULL)
 

Protected Member Functions

 buildQuery ($predicate)
 

Constructor & Destructor Documentation

◆ __construct()

OMV\Config\DatabaseBackendQueryBuilder::__construct (   $model)
Parameters
modelThe data model identifier or object.

Member Function Documentation

◆ buildPredicate()

OMV\Config\DatabaseBackendQueryBuilder::buildPredicate (   $filter)
final

Build the predicate for the specified filter. Supported operators: .----------------------------------------------—.

operator arg0 arg1
and assoc. array assoc. array
or assoc. array assoc. array
equals property name value
notEquals property name value
enum property name array
stringEquals property name value
stringNotEquals property name value
stringContains property name value
stringStartsWith property name value
stringEnum property name array
not assoc. array
less property name value
greater property name value
lessEqual property name value
greaterEqual property name value
distinct property name

'----------------------------------------------—' Example 1: [type='bond' and devicename='bond0'] The filter for the above predicate: [ "operator": "and", "arg0": [ "operator" => "stringEquals", "arg0" => "type", "arg1" => "bond" ], "arg1": [ "operator" => "stringEquals", "arg0" => "devicename", "arg1" => "bond0" ] ] Example 2: [type='bond' and contains(slaves,'eth0')] The filter for the above predicate: [ "operator": "and", "arg0": [ "operator" => "stringEquals", "arg0" => "type", "arg1" => "bond" ], "arg1": [ "operator" => "stringContains", "arg0" => "slaves", "arg1" => "eth0" ] ] Example 3: [not type='vlan'] The filter for the above predicate: [ "operator": "not", "arg0": [ "operator" => "stringEquals", "arg0" => "type", "arg1" => "vlan" ] ] Example 4: [ "operator" => "and", "arg0" => [ "operator" => "stringNotEquals", "arg0" => "uuid", "arg1" => $object->get("uuid") ], "arg1" => [ "operator" => "and", "arg0" => [ "operator" => "stringEquals", "arg0" => "mntentref", "arg1" => $object->get("mntentref") ], "arg1" => [ "operator" => "stringEquals", "arg0" => "reldirpath", "arg1" => $object->get("reldirpath") ] ] ]

Parameters
filterA filter specifying constraints to build the database query.
Returns
The database query string.
Exceptions

The documentation for this class was generated from the following file: