diff --git a/src/DataObjects/Folder.php b/src/DataObjects/Folder.php index 71d3914..b77f1cc 100644 --- a/src/DataObjects/Folder.php +++ b/src/DataObjects/Folder.php @@ -325,7 +325,7 @@ public function getCheckedOutDocs(OperationContextInterface $context = null) * @param OperationContextInterface|null $context * @return CmisObjectInterface[] A list of the child objects for the specified folder. */ - public function getChildren(OperationContextInterface $context = null) + public function getChildren(OperationContextInterface $context = null, $skipCount = 0) { $context = $this->ensureContext($context); $children = $this->getBinding()->getNavigationService()->getChildren( @@ -336,7 +336,9 @@ public function getChildren(OperationContextInterface $context = null) $context->isIncludeAllowableActions(), $context->getIncludeRelationships(), $context->getRenditionFilterString(), - $context->isIncludePathSegments() + $context->isIncludePathSegments(), + $context->getMaxItemsPerPage(), + $skipCount ); $result = []; @@ -350,6 +352,30 @@ public function getChildren(OperationContextInterface $context = null) return $result; } + /** + * Returns the number of children of this folder using the given OperationContext. + * + * @param OperationContextInterface|null $context + * @return int Total number of children. + */ + public function getNumChildren(OperationContextInterface $context = null) + { + $context = $this->ensureContext($context); + $children = $this->getBinding()->getNavigationService()->getChildren( + $this->getRepositoryId(), + $this->getId(), + $context->getQueryFilterString(), + $context->getOrderBy(), + $context->isIncludeAllowableActions(), + $context->getIncludeRelationships(), + $context->getRenditionFilterString(), + $context->isIncludePathSegments(), + 1 + ); + + return $children->getNumItems(); + } + /** * Gets the folder descendants starting with this folder. *