Gets the entity type from a Doctrine class name.

@param   string  $className
@return  string
969781
protected function getTypeForClassName($className)
    {
        if (empty($this->rootNamespace)) {
            return $className;
        }
        return $this->stripNamespace($this->rootNamespace, $className);
    }
387108
protected function getEntityName()
    {
        if (null === $this->entityName) {
            $name             = get_class($this);
            $type             = ucfirst($this->abstractType);
            $name             = str_replace($this->getModuleNamespace() . '\\' . $type . '\\', '', $name);
            $name             = str_replace($type, '', $name);
            $this->entityName = $name;
        }
        return $this->entityName;
    }
1292044
public function getEntityClassName()
    {
        if (null == $this->entityClassName) {
            $this->setEntityClassName(get_class($this->entity));
        }
        return $this->entityClassName;
    }
369870
public function getDocument($className)
    {
        if (isset($this->documents[$className])) {
            return $this->documents[$className];
        }
        if (!isset($this->mappings[$className])) {
            throw new \InvalidArgumentException(sprintf('No mapping found for document "%s"', $className));
        }

        return $this->documents[$className] = $this->processDocument(
            $className,
            $this->mappings[$className]['doctrine'],
            $this->mappings[$className]['serializer'],
            $this->mappings[$className]['schema']
        );
    }
675584
public static function getParent($className) {
		$reflection = ClassType::from($className);
		$parent = $reflection->getParentClass();
		return $parent ? $parent->getName() : $parent;
	}
1351879
protected function buildClassSchema($className)
    {
        $classSchema = new ClassSchema($className);
        $this->addPropertiesToClassSchema($classSchema);

        if ($this->isClassAnnotatedWith($className, ORM\Embeddable::class)) {
            return $classSchema;
        }

        if ($this->isClassAnnotatedWith($className, Flow\ValueObject::class)) {
            $this->checkValueObjectRequirements($className);
            $classSchema->setModelType(ClassSchema::MODELTYPE_VALUEOBJECT);

            return $classSchema;
        }

        if ($this->isClassAnnotatedWith($className, Flow\Entity::class) || $this->isClassAnnotatedWith($className, ORM\Entity::class)) {
            $classSchema->setModelType(ClassSchema::MODELTYPE_ENTITY);
            $classSchema->setLazyLoadableObject($this->isClassAnnotatedWith($className, Flow\Lazy::class));
        }

        $possibleRepositoryClassName = str_replace('\\Model\\', '\\Repository\\', $className) . 'Repository';
        if ($this->isClassReflected($possibleRepositoryClassName) === true) {
            $classSchema->setRepositoryClassName($possibleRepositoryClassName);
        }

        return $classSchema;
    }
1036429
private function getTypeByName($name)
    {
        if (isset($this->types[$name])) {
            return $this->doctrine
                ->getRepository('AnimeDbCatalogBundle:Type')
                ->find($this->types[$name]);
        }
    }
58410
public static function getClassName($className)
    {
        if (is_object($className)) {
            $className = get_class($className);
        }
        $className = array_slice(explode('\\', $className), - 1);
        return $className[0];
    }
21905
public function getRepository($className)
    {
        if (!is_string($className)) {
            throw new \InvalidArgumentException(sprintf('Class name must be a string, "%s" given.',
                is_object($className) ? 'Object ' . get_class($className) : gettype($className)
            ));
        }

        return parent::getRepository($className);
    }
229628
public function getTableClass($className) {
        $tableClass= null;
        if ($className= $this->loadClass($className)) {
            if (isset ($this->map[$className]['table'])) {
                $tableClass= $className;
            }
            if (!$tableClass && $ancestry= $this->getAncestry($className, false)) {
                foreach ($ancestry as $ancestor) {
                    if (isset ($this->map[$ancestor]['table'])) {
                        $tableClass= $ancestor;
                        break;
                    }
                }
            }
        }
        if ($tableClass) {
            if ($this->getDebug() === true) {
                $this->log(xPDO::LOG_LEVEL_DEBUG, 'Returning table class: ' . $tableClass . ' for class: ' . $className);
            }
        } else {
            $this->log(xPDO::LOG_LEVEL_ERROR, 'Could not get table class for class: ' . $className);
        }
        return $tableClass;
    }
1299093
public function getRepository($entityName)
    {
        $entityName = ltrim($entityName, '\\');
        if (isset($this->repositories[$entityName])) {
            return $this->repositories[$entityName];
        }

        $metadata = $this->getClassMetadata($entityName);
        $customRepositoryClassName = $metadata->customRepositoryClassName;

        if ($customRepositoryClassName !== null) {
            $repository = new $customRepositoryClassName($this, $metadata);
        } else {
            $repository = new XmlEntityRepository($this, $metadata);
        }

        $this->repositories[$entityName] = $repository;

        return $repository;
    }
289416
public function getEntityStructure($entityClassName)
    {
        if ($entityClassName instanceof Entity) {
            $reflection = new \ReflectionClass($entityClassName);
            $entityClassName = $reflection->getName();
        }

        if (! $this->isRegistered($entityClassName)) {
            $this->registerEntity($entityClassName);
        }
        return $this->entities[$entityClassName];
    }
794183
public static function get_type_by_typename($typename) {
        global $DB;
        $cache = cache::make('core', 'repositories');
        if (($repositorytype = $cache->get('typename:'. $typename)) === false) {
            $repositorytype = null;
            if ($record = $DB->get_record('repository', array('type' => $typename))) {
                $repositorytype = new repository_type($record->type, (array)get_config($record->type), $record->visible, $record->sortorder);
                $cache->set('typeid:'. $record->id, $repositorytype);
            }
            $cache->set('typename:'. $typename, $repositorytype);
        }
        return $repositorytype;
    }
795976
protected static function getClassProperties($className)
    {
        if (\class_exists($className, true)) {
            $reflection = new ReflectionClass($className);
            $value = $reflection->newInstanceWithoutConstructor();

            if (\is_subclass_of($value, Model::class, true)) {
                $attributes = Schema::getColumnListing($value->getTable());

                self::$eloquentClasses[$className] = $attributes;
            }
        }

        return (!empty(self::$eloquentClasses[$className])) ? self::$eloquentClasses[$className] : parent::getClassProperties($className);
    }
231104
public function getMappingByClassName(string $className) : Mapping
    {
        $className = ltrim($className, '\\');

        return (!empty($this->mappings[$className])) ? $this->mappings[$className] : Mapping::null();
    }
173902
function getRepository($entityName)
    {
        if (isset($this->cachedRepository[$entityName])) {
            return $this->cachedRepository[$entityName];
        }
        $className = "Fredy\\Model\\Repository\\Repository";
        $entityClassName = 'Model\\Entity\\'.$entityName;
        return new $className(new $entityClassName(),$this->db);
    }
777049
public function getInstance($className)
    {
        switch ($className) {
            case '\\Zepi\\DataSource\\Doctrine\\Manager\\EntityManager':
                if ($this->entityManager === null) {
                    $configurationManager = $this->framework->getInstance('\\Zepi\\Core\\Utils\\Manager\\ConfigurationManager');
                    
                    $params = array(
                        'driver' => $configurationManager->getSetting('doctrine.databaseDriver'),
                        'host' => $configurationManager->getSetting('doctrine.databaseHost'),
                        'dbname' => $configurationManager->getSetting('doctrine.databaseName'),
                        'user' => $configurationManager->getSetting('doctrine.databaseUser'),
                        'password' => $configurationManager->getSetting('doctrine.databasePassword')
                    );
                    
                    $paths = array();
                    foreach ($this->framework->getModuleManager()->getModules() as $module) {
                        $paths[] = $module->getDirectory() . '/src/';
                    }
                    
                    $environment = strtoupper($configurationManager->getSetting('environment'));
                    $isDevMode = false;
                    if ($environment == 'DEV') {
                        $isDevMode = true;
                    }
                      
                    $config = \Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
                    
                    $path = $this->prepareCacheDirectory($environment);
                    $config->setProxyDir($path);
                    
                    if ($environment == 'DEV') {
                        $config->setAutoGenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_ALWAYS);
                    } else {
                        $config->setAutoGenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_NEVER);
                    }
                    
                    $doctrineEntityManager = \Doctrine\ORM\EntityManager::create($params, $config);
                    
                    $this->entityManager = new \Zepi\DataSource\Doctrine\Manager\EntityManager($doctrineEntityManager);
                }
                
                return $this->entityManager;
            break;
            
            default: 
                return $this->framework->initiateObject($className);
            break;
        }
    }