Returns all RDF types (classes) of a given resource.
@return array
473
public function getClasses(): array {
        $this->loadMetadata();
        $ret = array();
        foreach ($this->metadata->allResources('http://www.w3.org/1999/02/22-rdf-syntax-ns#type') as $i) {
            $ret[] = $i->getUri();
        }
        return $ret;
    }
545797
private function getDocumentClasses()
    {
        /** @var MetadataCollector $metadataCollector */
        $metadataCollector = $this->getContainer()->get('es.metadata_collector');
        $classes = [];

        foreach ($this->getContainer()->getParameter('es.managers') as $manager) {
            $documents = $metadataCollector->getMappings($manager['mappings']);
            foreach ($documents as $document) {
                $classes[] = sprintf('%s:%s', $document['bundle'], $document['class']);
            }
        }

        return $classes;
    }
1234283
public function findEventTypes()
    {
        $xmlQuery = $this->metaApiService->getEventTypes();

        $types = new Types();

        $mapper = new \RGU\Dvoconnector\Mapper\EventTypes($xmlQuery);
        $mapper->mapToAbstractEntity($types);

        return $types;
    }
418018
protected function getRoutableNodeClasses()
    {
        $metadata = $this->manager->getClassMetadata(Node::class);
        $routables = array_values(array_filter($metadata->subClasses, function($subNode) {
            $reflection = new \ReflectionClass($subNode);
            return $reflection->implementsInterface(RoutableNodeInterface::class);
        }));

        return $routables;
    }
357226
public function getTypes()
    {
        $types = $this->config()->get('types');
        $i18nTypes = [];
        $allowedTypes = $this->config()->get('allowed_types');

        if ($this->allowed_types_override) {
            // Prioritise local field over global settings
            $allowedTypes = $this->allowed_types_override;
        }

        if ($allowedTypes) {
            foreach ($allowedTypes as $type) {
                if (!array_key_exists($type, $types)) {
                    user_error("{$type} is not a valid link type");
                }
            }

            foreach (array_diff_key($types, array_flip($allowedTypes)) as $key => $value) {
                unset($types[$key]);
            }
        }

        // Get translatable labels
        foreach ($types as $key => $label) {
            $i18nTypes[$key] = _t('Linkable.TYPE' . strtoupper($key), $label);
        }

        return $i18nTypes;
    }
621362
protected function getTypesLibrary()
    {
        $types = array();

        foreach (array_keys($this->library->getTypes()) as $id) {
            $types[$id] = $this->text(ucfirst($id));
        }

        return $types;
    }
504655
public function getTypes()
    {
        $classes = parent::getTypes();

        foreach ($classes as $k => &$definition) {

            if (empty($definition[$k]['properties'])) {
                unset($classes[$k]);
                continue;
            }

            $properties = array_filter(array_map(function ($property) {

                if (!empty($property['validation'])) {


                    foreach ($property['validation'] as &$rule){
                        foreach ($rule as $type => &$item) {

                            if ($type === 'Valid') {
                                continue;
                            } else {
                                if (!is_array($item)){
                                    $item = [];
                                }
                                $item['groups'] = ['xsd_rules'];
                            }

                        }
                        unset($item);
                    }
                    unset($rule);

                    return $property['validation'];
                }


                return null;
            }, $definition[$k]['properties']));

            if (empty($properties)) {
                unset($classes[$k]);
                continue;
            }

            $definition[$k] = [
                'properties' => $properties
            ];
        }

        return $classes;
    }
358497
public function getTypes()
    {
        $types = array(
            'brand' => $this->translation->text('Brand'),
            'common' => $this->translation->text('Common'),
            'catalog' => $this->translation->text('Catalog')
        );

        $this->hook->attach('category.group.types', $types, $this);
        return $types;
    }
61374
public function getFileTypes()
    {
        $result = array();
        if(is_array($this->__engines)) {
            $result = array_keys($this->__engines);
        }

        return $result;
    }
1022470
public function getTypes()
    {
        $options = ['select' => 'full', 'orderby' => 'name_asc', 'with_hierarchy' => true];
        $types = Ref::findCached('type,bill', 'hipanel:finance', $options);

        if (!$this->app->user->can('support')) {
            $types = $this->removeUnusedTypes($types);
        }

        return $types;
    }
1225536
public function getTypes()
    {
        $types = $this->config()->get('types');

        if ($this->allowed_types) {
            // Prioritise local field over global settings
            $allowed_types = $this->allowed_types;
        }
        if ($allowed_types = $this->config()->get('allowed_types')) {
           foreach ($allowed_types as $type) {
                if (!array_key_exists($type, $types)) {
                    user_error("{$type} is not a valid link type");
                }
            }

            foreach (array_diff_key($types, array_flip($allowed_types)) as $key => $value) {
                unset($types[$key]);
            }
        }
        $this->extend('updateTypes', $types);
        return $types;
    }
574161
protected function getAllResources(): array
    {
        return array_merge($this->resources, [
            $this->socket->getResourceId() => $this->socket->getResource(),
        ]);
    }
937661
public function getTypes()
    {
        if (!array_key_exists('value', $this->types)) {
            return;
        }

        //return an array, no matter one or many types defined
        if (is_array($this->types['value']) && count($this->types['value']) > 1) {
            return $this->types['value'];
        } else {
            return [$this->types['value']];
        }
    }
42042
public function getTypes() {
    // If type hint is set then that is the type of the parameter.
    if ($this->typeHint) {
      if ($this->typeHint instanceof TokenNode) {
        if ($this->typeHint->getType() === T_ARRAY) {
          $docTypes = $this->getDocTypes();
          foreach ($docTypes as $docType) {
            if ($docType !== 'array' && substr($docType, -2) !== '[]') {
              return [$this->typeHint->getText()];
            }
          }
          return $docTypes;
        }
        else {
          return [$this->typeHint->getText()];
        }
      }
      else {
        return [$this->typeHint->getAbsolutePath()];
      }
    }
    return $this->getDocTypes();
  }
1089861
def rdfs_classes(rdf):
    """"""

    # find out the subclass mappings
    upperclasses = {}  # key: class val: set([superclass1, superclass2..])
    for s, o in rdf.subject_objects(RDFS.subClassOf):
        upperclasses.setdefault(s, set())
        for uc in rdf.transitive_objects(s, RDFS.subClassOf):
            if uc != s:
                upperclasses[s].add(uc)

    # set the superclass type information for subclass instances
    for s, ucs in upperclasses.items():
        logging.debug("setting superclass types: %s -> %s", s, str(ucs))
        for res in rdf.subjects(RDF.type, s):
            for uc in ucs:
                rdf.add((res, RDF.type, uc))
1010161
public function getTypes() {
    // No type specified means type is mixed.
    $types = ['mixed'];
    // Use types from the doc comment if available.
    $doc_comment = $this->getDocComment();
    if (!$doc_comment) {
      return $types;
    }
    $doc_block = $doc_comment->getDocBlock();
    $var_tags = $doc_block->getTagsByName('var');
    if (empty($var_tags)) {
      return $types;
    }
    /** @var \phpDocumentor\Reflection\DocBlock\Tag\VarTag $var_tag */
    $var_tag = reset($var_tags);
    return Types::normalize($var_tag->getTypes());
  }
869187
public static function getTypes(): array
    {
        return [
            self::TYPE_DELIVERY => self::TYPE_DELIVERY,
            self::TYPE_SALE => self::TYPE_SALE,
            self::TYPE_REGULATION => self::TYPE_REGULATION,
            self::TYPE_RETURN => self::TYPE_RETURN,
        ];
    }