Beispiel #1
0
 /**
  * Returns metadata for the given query type
  *
  * @param string $queryType The query type
  * @return array
  */
 public function getMetadata($queryType)
 {
     $filtersMetadata = [];
     $filters = $this->getFilters($queryType);
     foreach ($filters as $filter) {
         $filtersMetadata[] = $filter->getMetadata();
     }
     return ['filters' => $filtersMetadata, 'grouping' => $this->getMetadataForGrouping(), 'converters' => $this->getMetadataForFunctions('converters', $queryType), 'aggregates' => $this->getMetadataForFunctions('aggregates', $queryType), 'hierarchy' => $this->entityHierarchyProvider->getHierarchy()];
 }
 /**
  * Checks if $entityClassName is equal to $className
  * or has $className as one of its parent entities/mapped superclasses
  *
  * @param string $entityClassName
  * @param string $className
  * @return bool
  */
 protected function isEntityMatched($entityClassName, $className)
 {
     if ($entityClassName === $className) {
         return true;
     }
     return in_array($className, $this->entityHierarchyProvider->getHierarchyForClassName($entityClassName));
 }
 /**
  * @dataProvider getHierarchyForClassNameProvider
  */
 public function testGetHierarchyForClassName($className, $expected)
 {
     $this->assertEquals($expected, $this->provider->getHierarchyForClassName($className));
 }