Recursively get all Qti Elements contained within the current Qti Element

@param string $className
@return array
967930
public function getComposingElements($className = ''){

        $returnValue = array();
        if($className === ''){
            $className = 'oat\taoQtiItem\model\qti\Element';
        }

        $reflection = new ReflectionClass($this);
        foreach($reflection->getProperties() as $property){
            if(!$property->isStatic() && !$property->isPrivate()){
                $propertyName = $property->getName();
                if($propertyName != 'relatedItem'){
                    $value = $this->$propertyName;
                    if(is_array($value)){
                        foreach ($value as $subvalue) {
                            if($subvalue instanceof Element){
                                if($subvalue instanceof $className){
                                    $returnValue[$subvalue->getSerial()] = $subvalue;
                                }
                                $returnValue = array_merge($returnValue, $subvalue->getComposingElements($className));
                            }
                        }
                    }else{
                        if($value instanceof Element){
                            if($value instanceof $className){
                                if($value->getSerial() != $this->getSerial()){
                                    $returnValue[$value->getSerial()] = $value;
                                }
                            }
                            $returnValue = array_merge($returnValue, $value->getComposingElements($className));
                        }
                    }
                }
            }
        }

        return $returnValue;
    }
664459
public static function getInjects($className)
    {
        $injects = AnnotationManager::getPropertiesAnnotations($className, Inject::class);
        $configs = static::getConfigInjects($className);
        foreach(array_keys($configs) as $key)
        {
            if(isset($injects[$key]))
            {
                unset($injects[$key]);
            }
        }
        return [$injects, $configs];
    }
805595
protected function getApiMapping($className)
    {
        $apiMapping = Config::inst()->get($className, 'api_field_mapping');
        if ($apiMapping && is_array($apiMapping)) {
            return $apiMapping;
        }
        return [];
    }
353349
protected static function getBindingsForApp(string $className): array
    {
        $bindings   = parent::getBindingsForApp($className);
        $bindings[] = function(Binder $binder)
        {
            $binder->bind(InputStream::class)
                   ->named('stdin')
                   ->toInstance(ConsoleInputStream::forIn());
            $binder->bind(OutputStream::class)
                   ->named('stdout')
                   ->toInstance(ConsoleOutputStream::forOut());
            $binder->bind(OutputStream::class)
                   ->named('stderr')
                   ->toInstance(ConsoleOutputStream::forError());
        };
        return $bindings;
    }
151800
private static function getTable(string $className): array
    {
        $entities   = EntityCollector::getCollector();
        $fields     = $entities[$className]['field'];
        $idProperty = $entities[$className]['table']['id'];
        $tableName  = $entities[$className]['table']['name'];
        $idColumn   = $fields[$idProperty]['column'];

        return [$tableName, $idProperty, $idColumn, $fields];
    }
1243977
public function getClassTagsValues($className)
    {
        if (!isset($this->reflectedClassNames[$className])) {
            $this->reflectClass($className);
        }
        if (!isset($this->classTagsValues[$className])) {
            return [];
        }
        return isset($this->classTagsValues[$className]) ? $this->classTagsValues[$className] : [];
    }
43983
public function toQTI(){
        $returnValue = $this->getBody();

        foreach($this->elements as $element){
            $returnValue = str_replace($element->getPlaceholder(), $element->toQTI(), $returnValue);
        }

        return (string) $returnValue;
    }
1013777
protected function buildLevel($classname)
    {
        $parts = explode('.', $classname);
        
        $lastLevel = &$this->methods;
        foreach ($parts as $part) {
            $lastLevel[$part] = array();
            $lastLevel = &$lastLevel[$part];
        }
        
        return $lastLevel;
    }
1191647
public function buildClass($className)
    {
        trigger_error(__CLASS__.' is no longer supported and will be removed in version 2', \E_USER_DEPRECATED);
        $class = $this->makeClass();
        $whitespace = $this->makeWhitespace(null);
        $string = $this->makeString($className);

        return array($class, $whitespace, $string);
    }
795682
public function parseClassName($className)
    {
        if (!preg_match('/^\\\\?(.*?)\\\\?([a-zA-Z0-9_]+)$/', $className, $matches)) {
            throw new \Exception('Invalid class name "' . $className . '" given');
        }

        return array(
            'namespace' => $matches[1],
            'classname' => $matches[2],
            'fqcn'      => $className
        );
    }
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;
    }
437912
static public function getParents($className)
    {
        $parents = [];
        $parent = new \ReflectionClass($className);
        while (true) {
            $parent = $parent->getParentClass();
            if (!$parent) {
                break;
            } else {
                $parents[] = $parent->getName();
            }
        }
        return $parents;
    }
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);
        }));
    }
939493
public static function getByClassName($className)
    {
        $bind = self::getInstance()->bind;

        foreach ($bind as $abstract => $abstractClassName) {
            if ($className == $abstractClassName) {
                return self::get($abstract);
            }
        }

        throw new ContainerException('Cannot find "' . $className . '" in container');
    }
577794
public function autoDetectModuleNameByClassName($className)
    {
        if (array_key_exists($className, $this->classNameToModuleName)) {
            $resultModuleName =  $this->classNameToModuleName[$className];
        } else {
            $index = $this->getModulesIndex();
            $classNameLength = strlen($className);

            $resultModuleName = null;
            foreach ($index as $moduleName => $moduleNameLength) {
                if ($classNameLength > $moduleNameLength && 0 === strrpos($className, $moduleName)) {
                    $resultModuleName = $moduleName;
                    break;
                }
            }
            $this->classNameToModuleName[$className] = $resultModuleName;
        }

        return $resultModuleName;
    }
907171
protected function getClassMetadata($className)
    {
        $class = clone $this->em->getClassMetadata($className);

        if (! isset($class->fieldMappings['revisionId'])) {
            $revisionMapping = [
                'fieldName' => 'revisionId',
                'columnName' => 'revision_id',
                'type' => 'integer',
            ];

            $class->mapField($revisionMapping);

            $revisionMapping = [
                'fieldName' => 'revisionType',
                'columnName' => 'rev_type',
                'type' => 'string',
            ];

            $class->mapField($revisionMapping);

            $revisionMapping = [
                'fieldName' => 'draft',
                'columnName' => 'draft',
                'type' => 'boolean',
            ];

            $class->mapField($revisionMapping);
        }

        return $class;
    }
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;
    }