/**
* Determine the type of an object by its tree position and other
* parameters.
*
* @param string $guid The GUID of the object to examine.
* @param array $ocs The object classes of the object to examine.
*
* @return string The class name of the corresponding object type.
*
* @throws Horde_Kolab_Server_Exception If the object type is unknown.
*/
protected function _determineType($guid, array $ocs)
{
$ocs = array_reverse($ocs);
foreach ($ocs as $oc) {
try {
$class_name = 'Horde_Kolab_Server_Object_' . ucfirst(strtolower($oc));
Horde_Kolab_Server_Object_Factory::loadClass($class_name);
return $class_name;
} catch (Horde_Kolab_Server_Exception $e) {
}
}
throw new Horde_Kolab_Server_Exception(sprintf("Unknown object type for GUID %s.", $guid), Horde_Kolab_Server_Exception::SYSTEM);
}