Properties

$hide_invisible

$hide_invisible : boolean

Set this element to true to hide all items which are currently invisible according to the approval/scheduling settings made using Metadata. This must be set before executing the query.

NOTE: Approval checks not implemented in collector yet

Be aware, that this setting will currently not use the QB to filter the objects accordingly, since there is no way yet to filter against parameters. This will mean some performance impact.

Type

boolean

$denied

$denied : integer

The number of objects for which access was denied.

Type

integer

$_visibility_checks_added

$_visibility_checks_added : boolean

Flag that tracks whether deleted visibility check have already been added

Type

boolean

$_limit

$_limit : integer

The number of records to return to the client at most.

Type

integer

$_offset

$_offset : integer

The offset of the first record the client wants to have available.

Type

integer

$_orders

$_orders : array

The ordering instructions used for this query

Type

array

$_real_class

$_real_class : string

Type that the application expects to retrieve from this instance.

Type

string

$count

$count : integer

The number of records found by the last execute() run. This is -1 as long as no query has been executed. This member is read-only.

Type

integer

$_query

$_query : \midgard\portable\query

The query backend, should be set in constructor. Currently collector or querybuilder

Type

\midgard\portable\query

Methods

get_doctrine()

get_doctrine() : \Doctrine\ORM\QueryBuilder

Returns

\Doctrine\ORM\QueryBuilder

get_current_group()

get_current_group() : \Doctrine\ORM\Query\Expr:

Returns

\Doctrine\ORM\Query\Expr:

add_constraint()

add_constraint(string  $field, string  $operator, mixed  $value) : boolean

Add a constraint to the query.

Parameters

string $field

The name of the MgdSchema property to query against.

string $operator

The operator to use for the constraint, currently supported are <, <=, =, <>, >=, >, LIKE. LIKE uses the percent sign ('%') as a wildcard character.

mixed $value

The value to compare against. It should be of the same type as the queried property.

Returns

boolean —

Indicating success.

add_constraint_with_property()

add_constraint_with_property(string  $field, string  $operator, string  $compare_field) : boolean

Add a constraint against another DB column to the query.

Parameters

string $field

The name of the MgdSchema property to query against.

string $operator

The operator to use for the constraint, currently supported are <, <=, =, <>, >=, >, LIKE. LIKE uses the percent sign ('%') as a wildcard character.

string $compare_field

The field to compare against.

Returns

boolean —

Indicating success.

begin_group()

begin_group(string  $operator = 'OR') 

Creates a new logical group within the query. They are set in parentheses in the final SQL and will thus be evaluated with precedence over the normal out-of-group constraints.

While the call lets you decide whether all constraints within the group are AND'ed or OR'ed, only OR constraints make logically sense in this context, which is why this proxy function sets 'OR' as the default operator.

Parameters

string $operator

One of 'OR' or 'AND' denoting the logical operation with which all constraints in the group are concatenated.

end_group()

end_group() 

Ends a group previously started with begin_group().

set_limit()

set_limit(integer  $limit) 

Limits the resultset to contain at most the specified number of records.

Set the limit to zero to retrieve all available records.

Parameters

integer $limit

The maximum number of records in the resultset.

set_offset()

set_offset(integer  $offset) 

Sets the offset of the first record to retrieve. This is a zero based index, so if you want to retrieve from the very first record, the correct offset would be zero, not one.

Parameters

integer $offset

The record number to start with.

add_order()

add_order(string  $field, string  $direction = 'ASC') : boolean

Add an ordering constraint to the query builder.

Parameters

string $field

The name of the MgdSchema property to query against.

string $direction

One of 'ASC' or 'DESC' indicating ascending or descending ordering. The default is 'ASC'.

Returns

boolean —

Indicating success.

get_classname()

get_classname() 

Get the DBA class we're currently working on

execute()

execute() 

count()

count() 

count_unchecked()

count_unchecked() 

_convert_class()

_convert_class(string  $classname) : string

Class resolution into the MidCOM DBA system.

Currently, Midgard requires the actual MgdSchema base classes to be used when dealing with the query, so we internally note the corresponding class information to be able to do correct typecasting later.

Parameters

string $classname

The classname which should be converted.

Returns

string —

MgdSchema class name

_add_visibility_checks()

_add_visibility_checks() 

_reset()

_reset() 

Resets some internal variables for re-execute