webCOMAND

cObject::get_dimension_with()

Return an array of dimensions associated with an object variant.  Optionally include the "*" (star wildcard) as a string in the last element in the array, to allow fallback if the return values are not available.

If the object has multiple dimensions, the first element in the array may be an array of dimensions itself that represents the primary with clause, followed by additional dimensions as fallbacks, potentially followed by the '*' string if $star is specified.

This method returns complex results and designed to support other API features rather than be used directly.  A method like get_dimensions() may be more useful.

Prototype

array get_dimensions_with(boolean $star = FALSE)

Parameters

  • star - If TRUE, will include "*" as last element in the resulting array, if there are dimensions.  If FALSE (default), no "*" element will be returned.

Return

An array that contains each dimension object that represents the primary WITH clause that could be used to select this object.  If the object has multiple dimensions, the first element in the array may be an array of dimensions itself that represents the primary with clause, followed by additional dimensions as fallbacks, potentially followed by the '*' string if $star is specified.

Example

// get all contacts in the same dimension as the first found
$repo = \comand::repo();
$obj = $repo->get_object_by_oid(123);
$dimensions = $obj->get_dimension_with();
echo("Dimensions WITH: " . print_r($dimensions, TRUE));

Related

get_dimensions()