The Grand Unified Reflector, Tree information

package midcom.helper.reflector

 Methods

_child_objects_type_qb ($schema_type, $for_object, $deleted)

Creates a QB instance for _get_child_objects_type and _count_child_objects_type

Parameters

$schema_type

$for_object

$deleted

_count_child_objects_type ($schema_type, $for_object, $deleted)

Used by count_child_objects

Parameters

$schema_type

$for_object

$deleted

Returns

arrayof objects

_get_child_objects_type ($schema_type, $for_object, $deleted)

Used by get_child_objects

Parameters

$schema_type

$for_object

$deleted

Returns

arrayof objects

_get_parent_objectresolver ($object, $property)

Parameters

$object

$property

_resolve_child_classes ()

Resolve the child classes of the class this reflector was instantiated for, used by get_child_classes()

Returns

arrayof class names (or false on critical failure)

_root_objects_qb ($deleted)

Creates a QB instance for get_root_objects and count_root_objects
access private

Parameters

$deleted

add_schema_sorts_to_qb (\midgard_query_builder $qb, string $schema_type)

Static method to add default ("title" and "name") sorts to a QB instance
Static

Parameters

$qb

\midgard_query_builderreference to QB instance

$schema_type

stringvalid mgdschema class name

count_child_objects (\midgard_object $object, boolean $deleted)

Statically callable method to count children of given object

Parameters

$object

\midgard_object&$object object to get children for

$deleted

booleanwhether to count (only) deleted or not-deleted objects

Returns

arraymultidimensional array (keyed by classname) of objects or false on failure

count_root_objects (boolean $deleted)

Get count of "root" objects for the class this reflector was instantiated for
see \get_root_objects

Parameters

$deleted

booleanwhether to count (only) deleted or not-deleted objects

Returns

arrayof objects or false on failure

get (mixed $src)

Static

Parameters

$src

mixedclassname or object

Returns

\midcom_helper_reflector_treeReflector instance

get_child_classes ()

Get the child classes of the class this reflector was instantiated for

Returns

arrayof class names (or false on critical failure)

get_child_objects (\midgard_object $object, boolean $deleted)

Get children of given object
Static

Parameters

$object

\midgard_object&$object object to get children for

$deleted

booleanwhether to get (only) deleted or not-deleted objects

Returns

arraymultidimensional array (keyed by classname) of objects or false on failure

get_parent (\midgard_object $object)

Get the parent object of given object
Static

Tries to utilize MidCOM DBA features first but can fallback on pure MgdSchema as necessary

NOTE: since this might fall back to pure MgdSchema never trust that MidCOM DBA features are available, check for is_callable/method_exists first !

Parameters

$object

\midgard_object&$object the object to get parent for

get_parent_class ()

Get the parent class of the class this reflector was instantiated for

Returns

stringclass name (or false if the type has no parent)

get_root_classes ()

Get an array of "root level" classes, can (and should) be called statically
Static

Returns

arrayof classnames (or false on critical failure)

get_root_objects (boolean $deleted)

Get "root" objects for the class this reflector was instantiated for

NOTE: deleted objects can only be listed as admin, also: they do not come MidCOM DBA wrapped (since you cannot normally instantiate such object)

Parameters

$deleted

booleanwhether to get (only) deleted or not-deleted objects

Returns

arrayof objects or false on failure

has_child_objects (\midgard_object $object, boolean $deleted)

Statically callable method to determine if given object has children

Parameters

$object

\midgard_object&$object object to get children for

$deleted

booleanwhether to count (only) deleted or not-deleted objects

Returns

arraymultidimensional array (keyed by classname) of objects or false on failure

has_root_objects ($deleted)

Parameters

$deleted

resolve_path (\midgard_object $object, string $separator, \GUID $stop_at)

Method to get rendered path for object
Static

Parameters

$object

\midgard_object&$object, the object to get path for

$separator

stringthe string used to separate path components

$stop_at

\GUIDin case we wish to stop resolving at certain object give guid here

Returns

stringresolved path

resolve_path_parts (\midgard_object $object, \GUID $stop_at)

Get path components for object
Static

Parameters

$object

\midgard_object&$object, the object to get path for

$stop_at

\GUIDin case we wish to stop resolving at certain object give guid here

Returns

arraypath components

_resolve_root_classes ()

Resolves the "root level" classes, used by get_root_classes()
Static

Returns

arrayof classnames (or false on critical failure)