Get available property groups by class name.

@param string $className

@return array
@throws Exception
434549
public static function getAvailablePropertyGroupsList($className)
    {
        $applicablePropertyModelId = PropertiesHelper::applicablePropertyModelId($className);
        $availableGroups = Yii::$app->cache->lazy(
            function () use ($applicablePropertyModelId) {
                return ArrayHelper::map(
                    PropertyGroup::find()->where(
                        ['applicable_property_model_id' => $applicablePropertyModelId]
                    )->orderBy('sort_order ASC')->all(),
                    'id',
                    function ($model) {
                        return !empty($model->name) ? $model->name : $model->internal_name;
                    }
                );

            },
            'AvailablePropertyGroupsList: ' . $applicablePropertyModelId,
            86400,
            PropertyGroup::commonTag()
        );
        return $availableGroups;
    }
175410
protected function getGroup($classname)
    {
        $category = FieldCategory::query()->firstOrCreate([
            'name' => strtolower(last(explode('\\', $classname)))
        ]);
        return FieldGroup::query()->firstOrCreate([
                    'category_id' => $category->id,
                    'name'        => $category->name,
        ]);
    }
493771
public static function get_templates_for_class($classname)
    {
        $classes = ClassInfo::ancestry($classname);
        $classes = array_reverse($classes);
        $remove_classes = self::config()->classes_to_remove;
        $return = array();

        array_push($classes, "Catalogue", "Page");

        foreach ($classes as $class) {
            if (!in_array($class, $remove_classes)) {
                $return[] = $class;
            }
        }
        
        return $return;
    }
709271
public function create(string $className): array
    {
        $this->findIdentityField($className);

        $class = $this->metadata->getReflectionClass();
        $methods = $class->getMethods(ReflectionMethod::IS_PUBLIC);
        $fieldConfigurations = [];
        foreach ($methods as $method) {
            // Skip non-callable or non-instance
            if ($method->isAbstract() || $method->isStatic()) {
                continue;
            }

            // Skip non-getter methods
            $name = $method->getName();
            if (!preg_match($this->getMethodPattern(), $name)) {
                continue;
            }

            // Skip exclusion specified by user
            if ($this->isExcluded($method)) {
                continue;
            }

            $configuration = $this->methodToConfiguration($method);
            if ($configuration) {
                $fieldConfigurations[] = $configuration;
            }
        }

        return $fieldConfigurations;
    }
805595
protected function getApiMapping($className)
    {
        $apiMapping = Config::inst()->get($className, 'api_field_mapping');
        if ($apiMapping && is_array($apiMapping)) {
            return $apiMapping;
        }
        return [];
    }
750315
public static function getAttributeNamesByClassName($className = '', $throwException = false)
    {
        $except = false;
        if (empty($className) === false) {
            $model = new $className;
            if ($model instanceof Model) {
                /** @var $model Model */
                return $model->attributeLabels();
            } else {
                $except = true;
            }
        }
        if ($throwException && $except) {
            throw new Exception;
        } else {
            return [];
        }
    }
273733
protected function buildClassSchema($className)
    {
        if (!class_exists($className)) {
            throw new Exception('The classname "' . $className . '" was not found and thus can not be reflected.', 1278450972);
        }
        $classSchema = $this->objectManager->get(ClassSchema::class, $className);
        if (is_subclass_of($className, \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class)) {
            $classSchema->setModelType(ClassSchema::MODELTYPE_ENTITY);
            $possibleRepositoryClassName = ClassNamingUtility::translateModelNameToRepositoryName($className);
            if (class_exists($possibleRepositoryClassName)) {
                $classSchema->setAggregateRoot(true);
            }
        } elseif (is_subclass_of($className, \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject::class)) {
            $classSchema->setModelType(ClassSchema::MODELTYPE_VALUEOBJECT);
        }
        foreach ($this->getClassPropertyNames($className) as $propertyName) {
            if (!$this->isPropertyTaggedWith($className, $propertyName, 'transient') && $this->isPropertyTaggedWith($className, $propertyName, 'var')) {
                $cascadeTagValues = $this->getPropertyTagValues($className, $propertyName, 'cascade');
                $classSchema->addProperty($propertyName, implode(' ', $this->getPropertyTagValues($className, $propertyName, 'var')), $this->isPropertyTaggedWith($className, $propertyName, 'lazy'), $cascadeTagValues[0] ?? null);
            }
            if ($this->isPropertyTaggedWith($className, $propertyName, 'uuid')) {
                $classSchema->setUuidPropertyName($propertyName);
            }
            if ($this->isPropertyTaggedWith($className, $propertyName, 'identity')) {
                $classSchema->markAsIdentityProperty($propertyName);
            }
        }
        $this->classSchemata[$className] = $classSchema;
        $this->dataCacheNeedsUpdate = true;
        return $classSchema;
    }
58410
public static function getClassName($className)
    {
        if (is_object($className)) {
            $className = get_class($className);
        }
        $className = array_slice(explode('\\', $className), - 1);
        return $className[0];
    }
1022178
public function getPropertiesRequiredFor(string $columnName) : array
    {
        $propertyNames = [];

        foreach ($this->propertyComponentIdMap as $propertyName => $componentId) {
            if ($this->getColumnNameFromComponentId($componentId) === $columnName) {
                $propertyNames[$propertyName] = $propertyName;
            }
        }

        return $propertyNames;
    }
969781
protected function getTypeForClassName($className)
    {
        if (empty($this->rootNamespace)) {
            return $className;
        }
        return $this->stripNamespace($this->rootNamespace, $className);
    }
2742
protected function usedClass(ClassName $className)
    {
        foreach ($this->usedClasses() as $tuple) {
            list($usedClass, $as) = $tuple;
            if ($this->comparator()->equals($as, $className)) {
                return $usedClass;
            }
        }

        return null;
    }
1032842
public function getClassPropertyNames($className)
    {
        if (!isset($this->reflectedClassNames[$className])) {
            $this->reflectClass($className);
        }
        return isset($this->classPropertyNames[$className]) ? $this->classPropertyNames[$className] : [];
    }
620324
public function findAllByClass($className)
    {
        return array_values(array_filter($this->operationRunners, function (OperationRunner $operationRunner) use ($className) {
            return get_class($operationRunner) == $className || is_subclass_of($operationRunner, $className);
        }));
    }
1180480
public function getFieldsByClass($className)
    {
        $result = [];

        foreach ($this->fields as $field) {
            if ($field instanceof $className ||
                get_class($field) == $className ||
                (new \ReflectionClass($field))->getShortName() == $className
            ) {
                $result[] = $field;
            }
        }

        return $result;
    }
1177301
public static function getAttributesFor($className)
    {
        if (!self::attributesSetFor($className)) {
            # Force initialize.
            $className::getAttributeSet();
        }
        return self::$classAttributes[$className];
    }
697026
public function getResultsAsObjects($classname)
    {
        $new = array();
        foreach ((array) $this->results as $result) {
            if (is_array($result))
                $new[] = new $classname($result);
            else
                $new[] = $result;
        }
        return $new;
    }
1076873
public function getByClassname(string $classname)
    {
        foreach ($this->container as $value) {
            if (is_object($value) && $value instanceof $classname) {
                return $value;
            }
        }

        return null;
    }