You are here

function CMISService::query in CMIS API 7

Same name and namespace in other branches
  1. 6.4 cmis_common/lib/cmis_repository_wrapper.php \CMISService::query()
  2. 6.3 cmis_common/lib/cmis_repository_wrapper.php \CMISService::query()

File

cmis_common/lib/cmis_repository_wrapper.php, line 625

Class

CMISService

Code

function query($q, $options = array()) {
  static $query_template;
  if (!isset($query_template)) {
    $query_template = CMISService::getQueryTemplate();
  }
  $default_hash_values = array(
    "includeAllowableActions" => "true",
    "searchAllVersions" => "false",
    "maxItems" => 10,
    "skipCount" => 0,
  );
  $hash_values = array_merge($default_hash_values, $options);
  $hash_values['q'] = $q;
  $post_value = CMISRepositoryWrapper::processTemplate($query_template, $hash_values);
  $ret = $this
    ->doPost($this->workspace->collections['query'], $post_value, MIME_CMIS_QUERY);
  $objs = $this
    ->extractObjectFeed($ret->body);
  $this
    ->cacheFeedInfo($objs);
  return $objs;
}