settings)) { // grab default folderId from repository's settings $object_id = $repository->settings['browser_default_folderId']; } elseif (array_key_exists('browser_default_folderPath', $repository->settings)) { // grab default folderPath from repository's settings $object_path = drupal_encode_path($repository->settings['browser_default_folderPath']); } else { // fallback to repository's root folderId $object_id = $repository->info->repositoryInfo['cmis:rootFolderId']; } if (!is_null($object_id)) { $object = cmisapi_getProperties($repository->repositoryId, $object_id); } elseif (!is_null($object_path)) { $object = cmisapi_getObjectByPath($repository->repositoryId, $object_path); } else { throw new CMISException('Unknown CMIS object'); } return $object; }