webCOMAND

cObject::get_primary_cpath()

Return the "primary cPath" of an object.  The primary cPath is based on the first folder/collection that an object was added to or referenced from, all the way up the repository hierarchy to the root object.  If an object is not referenced from another object, the cPath will simply identify the object with a simple OID-based filter (ie. [OID=123]).

Prototype

cpath get_primary_cpath(boolean $self = TRUE)

Parameters

  • $self - If TRUE, this object include be included at the end of the resulting cPath.

Return

Primary cPath used to access the object.

Example

$repo = \comand::repo();
$contact = $repo->get_first('FROM Contact');
$cpath = $contact->get_primary_cpath();
echo("cPath=$cpath");