public function SymfonyFileLocator::getAllClassNames

Get all class names that are found with this file locator.

Parameters

string $globalBasename Passed to allow excluding the basename:

Return value

array

Overrides FileLocator::getAllClassNames

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php, line 148

Class

SymfonyFileLocator
The Symfony File Locator makes a simplifying assumptions compared to the DefaultFileLocator. By assuming paths only contain entities of a certain namespace the mapping files consists of the short classname only.

Namespace

Doctrine\Common\Persistence\Mapping\Driver

Code

public function getAllClassNames($globalBasename = null) {
  $classes = array();
  if ($this->paths) {
    foreach ((array) $this->paths as $path) {
      if (!is_dir($path)) {
        throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
      }
      $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::LEAVES_ONLY);
      foreach ($iterator as $file) {
        $fileName = $file
          ->getBasename($this->fileExtension);
        if ($fileName == $file
          ->getBasename() || $fileName == $globalBasename) {
          continue;
        }

        // NOTE: All files found here means classes are not transient!
        if (isset($this->prefixes[$path])) {
          $classes[] = $this->prefixes[$path] . '\\' . str_replace('.', '\\', $fileName);
        }
        else {
          $classes[] = str_replace('.', '\\', $fileName);
        }
      }
    }
  }
  return $classes;
}