public function testSetOrderBySetsProperty() { $this->operationContext->setOrderBy('foo ASC, Bar desc'); $this->assertAttributeSame('foo ASC, Bar desc', 'orderBy', $this->operationContext); }
/** * Creates a new operation context object with the given properties. * * @param string[] $filter the property filter, a comma separated string of query names or "*" for all * properties or <code>null</code> to let the repository determine a set of properties * @param boolean $includeAcls indicates whether ACLs should be included or not * @param boolean $includeAllowableActions indicates whether Allowable Actions should be included or not * @param boolean $includePolicies indicates whether policies should be included or not * @param IncludeRelationships|null $includeRelationships enum that indicates if and which * relationships should be includes * @param string[] $renditionFilter the rendition filter or <code>null</code> for no renditions * @param boolean $includePathSegments indicates whether path segment or the relative path segment should * be included or not * @param string|null $orderBy the object order, a comma-separated list of query names and the ascending * modifier "ASC" or the descending modifier "DESC" for each query name * @param boolean $cacheEnabled flag that indicates if the object cache should be used * @param integer $maxItemsPerPage the max items per page/batch * @return OperationContextInterface the newly created operation context object */ public function createOperationContext($filter = array(), $includeAcls = false, $includeAllowableActions = true, $includePolicies = false, IncludeRelationships $includeRelationships = null, array $renditionFilter = array(), $includePathSegments = true, $orderBy = null, $cacheEnabled = false, $maxItemsPerPage = 100) { $operationContext = new OperationContext(); $operationContext->setFilter($filter); $operationContext->setIncludeAcls($includeAcls); $operationContext->setIncludeAllowableActions($includeAllowableActions); $operationContext->setIncludePolicies($includePolicies); if ($includeRelationships !== null) { $operationContext->setIncludeRelationships($includeRelationships); } $operationContext->setRenditionFilter($renditionFilter); $operationContext->setIncludePathSegments($includePathSegments); if (!empty($orderBy)) { $operationContext->setOrderBy($orderBy); } $operationContext->setCacheEnabled($cacheEnabled); $operationContext->setMaxItemsPerPage($maxItemsPerPage); return $operationContext; }