Doctrine\ODM\OrientDB\Mapper\ClassMetadataFactory::findClassMappingInDirectory PHP Method

findClassMappingInDirectory() protected method

Searches a PHP class mapping Doctrine\OrientDB's $OClass in $directory, which uses the given $namespace.
protected findClassMappingInDirectory ( string $OClass, string $directory, string $namespace ) : string | null
$OClass string
$directory string
$namespace string
return string | null
    protected function findClassMappingInDirectory($OClass, $directory, $namespace)
    {
        $finder = new Finder();
        if (isset($this->classMap[$OClass])) {
            return $this->classMap[$OClass];
        }
        foreach ($finder->files()->name('*.php')->in($directory) as $file) {
            $class = $this->getClassByPath($file, $namespace);
            if (class_exists($class)) {
                $annotation = $this->getClassAnnotation($class);
                if ($annotation && $annotation->hasMatchingClass($OClass)) {
                    $this->classMap[$OClass] = $class;
                    return $class;
                }
            }
        }
        return null;
    }