Wrapper for midcom_core_collector.

It adds some additional logic to return related objects directly

package org.openpsa.relatedto

 Methods

__construct (mixed $guids, mixed $classes, string $direction)

Constructor, takes one or more object guids and classnames and constructs a collector accordingly.

Attention: At least one of these arguments has to be a string

Parameters

$guids

mixedOne or more object guids

$classes

mixedOne or more target classes

$direction

stringincoming or outgoing

add_object_constraint (string $field, string $operator, mixed $value)

Helper function that saves object QB constraints for later use

Parameters

$field

stringThe DB field

$operator

stringThe constraint operator

$value

mixedThe constraint value

add_object_order (string $field, string $direction)

Helper function that saves object QB constraints for later use

Parameters

$field

stringThe DB field

$direction

stringThe direction (ASC, DESC)

set_object_limit (integer $limit)

Helper function that saves object QB constraints for later use

Parameters

$limit

integerThe query limit

_apply_object_constraints (\midcom_core_querybuilder $qb)

Helper function that applies constraints (if any) to the final object QBs

Parameters

$qb

\midcom_core_querybuilder&$qb the QB instance in question

_apply_object_limit (\midcom_core_querybuilder $qb)

Helper function that applies the limit (if any) to the final object QBs

Parameters

$qb

\midcom_core_querybuilder&$qb the QB instance in question

_apply_object_orders (\midcom_core_querybuilder $qb)

Helper function that applies orders (if any) to the final object QBs

Parameters

$qb

\midcom_core_querybuilder&$qb the QB instance in question

_set_direction ($dir)

Parameters

$dir

 Properties

 

string $_direction

Which type of links are we looking for, incoming or outgoing
 

array $_object_constraints

Additional constraints for the QBs used to find the related objects
 

integer $_object_limit

Limit for the QBs used to find the related objects
 

array $_object_orders

Orders for the QBs used to find the related objects
 

string $_object_prefix

The prefix for query constraints concerning the object(s) at hand
 

string $_other_prefix

The prefix for query constraints concerning the objects we're looking for
 

string $_target_classes

The class(es) of the objects we're looking for