code: public function getItems(\core_kernel_classes_Class $itemClass, array $propertyFilters = [], $offset = 0, $limit = 30)
      {
          $data =  $this->getTreeResourceLookupService()->getResources($itemClass, [], $propertyFilters, $offset, $limit);
          return $this->formatTreeData($data);
      }
docs: Retrieve QTI Items in their hierarchy, for the given parameters as format them as tree.
  @param \core_kernel_classes_Class $itemClass the item class
  @param array $propertyFilters propUri/propValue to search items
  @param int    $offset for paging
  @param int    $limit  for paging
  @return array the items