Returns the implementation from the content class

@param core_kernel_classes_Class $contentClass
@return taoDelivery_models_classes_ContentModel
182241
public function getImplementationByContentClass(core_kernel_classes_Class $contentClass)
    {
        $classname = (string) $contentClass->getOnePropertyValue(new core_kernel_classes_Property(DeliveryContent::PROPERTY_IMPLEMENTATION));
        if (empty($classname)) {
            throw new common_exception_NoImplementation('No implementation found for contentClass ' . $contentClass->getUri());
        }
        if (! class_exists($classname) || ! in_array('oat\\taoDeliveryTemplate\\model\\ContentModel', class_implements($classname))) {
            throw new common_exception_Error('Content implementation '.$classname.' not found, or not compatible for content class '.$contentClass->getUri());
             
        }
        return new $classname();
    }
1194958
private function findSupportedObjectTransformer($supportedClass, $targetClass)
    {
        $objectTransformers = $this->getObjectTransformers();
        if (isset($objectTransformers[$supportedClass]) && isset($objectTransformers[$supportedClass][$targetClass])) {
            return $objectTransformers[$supportedClass][$targetClass];
        }

        $supportedReflectionClass = new \ReflectionClass($supportedClass);

        if ($supportedReflectionClass->getParentClass()
            && ($objectTransformer = $this->findSupportedObjectTransformer($supportedReflectionClass->getParentClass()->getName(), $targetClass))
        ) {
            return $objectTransformer;
        }

        $targetReflectionClass = new \ReflectionClass($targetClass);
        if ($targetReflectionClass->getParentClass()
            && ($objectTransformer = $this->findSupportedObjectTransformer($supportedClass, $targetReflectionClass->getParentClass()->getName()))
        ) {
            return $objectTransformer;
        }

        return null;
    }
276641
public function getPropertyDiff(core_kernel_classes_Class $sourceClass, core_kernel_classes_Class $destinationClass)
    {
        $returnValue = array();
        $sourceProperties = $sourceClass->getProperties(true);
        $destinationProperties = $destinationClass->getProperties(true);
        foreach ($sourceProperties as $sourcePropertyUri => $sourceProperty) {
            if (!array_key_exists($sourcePropertyUri, $destinationProperties)) {
                $sourceProperty->getLabel();
                array_push($returnValue, $sourceProperty);
            }
        }
        return (array) $returnValue;
    }
654890
public static function addDecoder(string $class, string ...$contentTypes)
    {
        $interface = decoder\DecoderInterface::class;
        if (!is_subclass_of($class, $interface)) {
            throw new \InvalidArgumentException(
                "invalid value provided for 'class'; ".
                "expecting the name of a class that implements '$interface'"
            );
        }

        foreach ($contentTypes as $type) {
            static::$decoders[$class] = $type;
        }
    }
548753
public function getFamily(string $resourceClass): FamilyInterface
    {
        $matchingFamilies = $this->getFamilies($resourceClass);

        if (1 === \count($matchingFamilies)) {
            return reset($matchingFamilies);
        }

        throw new \LogicException("Cannot resolve family for class '{$resourceClass}'");
    }
1367032
protected function getClassMetadata(string $resourceClass): ClassMetadata
    {
        return $this
            ->getManagerRegistry()
            ->getManagerForClass($resourceClass)
            ->getClassMetadata($resourceClass);
    }
1365761
public function getModule(string $class) : Module
    {
        foreach ($this->modules as $module) {
            if ($module instanceof $class) {
                return $module;
            }
        }

        throw new \InvalidArgumentException("No register module modules with class '%s'", get_class($class));
    }
841474
protected function getControllerInstance($class)
    {
        if (!isset($this->controllerInstances[$class])) {
            $this->controllerInstances[$class] = new $class(array(
                'wei' => $this->wei,
                'app' => $this,
            ));
        }

        return $this->controllerInstances[$class];
    }
253839
public static function getClass($class) {
        $cache = null;

        if (is_object($class)) {
            $cache = new Cache('gcs_cache_annotation_' . strtolower(str_replace('\\', '-', get_class($class))), 0);
        }
        else {
            $cache = new Cache('gcs_cache_annotation_' . strtolower(str_replace('\\', '-', $class)), 0);
        }

        if ($cache->isExist() && Config::config()['user']['debug']['environment'] != 'development') {
            return $cache->getCache();
        }

        $data = ['class' => [], 'methods' => [], 'properties' => []];

        $reflectionClass = new \ReflectionClass($class);

        //Class annotations
        $parser = new Parser($reflectionClass->getDocComment());
        $dataClasses = $parser->parse();

        foreach ($dataClasses as $key => $dataClass) {
            $processorClass = new Processor($dataClass);
            array_push($data['class'], [0 => ['annotation' => $dataClass['type'], 'instance' => $processorClass->process()]]);
        }

        //Method annotations
        $methodsName = $reflectionClass->getMethods();

        foreach ($methodsName as $methodName) {
            $method = new \ReflectionMethod($class, $methodName->getName());

            $parser = new Parser($method->getDocComment());
            $dataMethods = $parser->parse();

            if (count($dataMethods) > 0) {
                $data['methods'][$methodName->getName()] = [];

                foreach ($dataMethods as $key => $dataMethod) {
                    $processorMethods = new Processor($dataMethod);
                    array_push($data['methods'][$methodName->getName()], ['annotation' => $dataMethod['type'], 'instance' => $processorMethods->process()]);
                }
            }
        }

        //Properties annotations
        $propertiesNames = $reflectionClass->getProperties();

        foreach ($propertiesNames as $propertyName) {
            $property = new \ReflectionProperty($class, $propertyName->getName());

            $parser = new Parser($property->getDocComment());
            $dataProperties = $parser->parse();

            if (count($dataProperties) > 0) {
                $data['properties'][$propertyName->getName()] = [];

                foreach ($dataProperties as $key => $dataProperty) {
                    $processorProperties = new Processor($dataProperty);
                    array_push($data['properties'][$propertyName->getName()], ['annotation' => $dataProperty['type'], 'instance' => $processorProperties->process()]);
                }
            }
        }

        $cache->setContent($data);
        $cache->setCache();

        return $data;
    }
499721
public function getExecutionsByDelivery(core_kernel_classes_Resource $compiled)
    {
        if (!$this->implementsMonitoring()) {
            throw new common_exception_NoImplementation(get_class($this->getImplementation()).' does not implement \oat\taoDelivery\model\execution\Monitoring');
        }
        return $this->getImplementation()->getExecutionsByDelivery($compiled);
    }
556939
public function getRelationshipEntityMetadata($class)
    {
        if (!array_key_exists($class, $this->loadedMetadata)) {
            $metadata = $this->metadataFactory->create($class);
            if (!$metadata instanceof RelationshipEntityMetadata) {
                // $class is not an relationship entity
                throw new MappingException(sprintf('The class "%s" was configured to be an RelationshipEntity but no @OGM\RelationshipEntity class annotation was found', $class));
            }
            $this->loadedMetadata[$class] = $metadata;
        }

        return $this->loadedMetadata[$class];
    }
1115378
private function getService($class)
    {
        if (!array_key_exists($class, $this->services)) {
            $this->services[$class] = new $class($this->getClient(), $this->getLogger());
        }

        return $this->services[$class];
    }
937898
protected function loadResources(core_kernel_classes_Class $class, $offset)
    {
        $search = $this->getServiceLocator()->get(ComplexSearchService::SERVICE_ID);
        $queryBuilder = $search->query()->setLimit(self::CACHE_SIZE)->setOffset($offset);

        $criteria = $search->searchType($queryBuilder, $class->getUri(), false);
        if ($this->criteria !== null) {
            foreach ($this->criteria->getStoredQueryCriteria() as $storedQueryCriterion) {
                $criteria->addCriterion(
                    $storedQueryCriterion->getName(),
                    $storedQueryCriterion->getOperator(),
                    $storedQueryCriterion->getValue()
                );
            }
        }
        $queryBuilder = $queryBuilder->setCriteria($criteria);
        return $search->getGateway()->search($queryBuilder);
    }
130701
public function loadOne($class = '\\stdClass')
    {
        if (strtolower($class) === 'array') {
            return $this->getReader()->loadArray();
        }

        if (strtolower($class) === 'assoc') {
            return $this->getReader()->loadAssoc();
        }

        return $this->getReader()->loadObject($class);
    }
244635
protected function getConverter($contentType)
    {
        if (!isset($this->supportedMediaTypes[$contentType])) {
            throw new Exception("No converter found for content type '$contentType'");
        }

        $converterClass = $this->supportedMediaTypes[$contentType];

        return new $converterClass;
    }
317912
protected function getEntityMapInstanceFromCache(string $entityClass)
    {
        if ($this->cache == null) {
            return;
        }

        if ($this->cache->has($entityClass)) {
            return unserialize($this->cache->get($entityClass));
        }
    }
63337
public function getItemModel(core_kernel_classes_Resource $item)
    {
        $returnValue = null;

        $itemModel = $item->getOnePropertyValue($this->itemModelProperty);
        if ($itemModel instanceof core_kernel_classes_Resource) {
            $returnValue = $itemModel;
        }

        return $returnValue;
    }