Reduce an entity path to the name that entity gets in the DQL, by linking field names with underscores
@param array[] $entityPath
@return string
966065
private static function implodeEntityPath(array $entityPath): string
    {
        $fields = [];
        foreach ($entityPath as $item) {
            $fields[] = $item['field'];
        }
        return implode(':', $fields);
    }
842702
protected function formatPathWithEmptyBaseQuery(string $path): string
    {
        $target_segments = $this->getSegments($path);
        $basename = end($target_segments);

        return '' === $basename ? './' : $basename;
    }
1159736
protected function getNames(ResourcePath $path)
    {
        return isset($this->names[$path->method]) ? [$path->method => $this->names[$path->method]] : [];
    }
1201519
protected function getRootRelatedPath(string $filePath): string
    {
        return $this->getRootDirectory() . DIRECTORY_SEPARATOR . trim($filePath, DIRECTORY_SEPARATOR);
    }
786850
function extractPath(schemaPath) {
  const subNames = schemaPath.path.split('.');

  return reduceRight(subNames, (fields, name, key) => {
    const obj = {};

    if (schemaPath instanceof mongoose.Schema.Types.DocumentArray) {
      const subSchemaPaths = schemaPath.schema.paths;
      const fields = extractPaths(subSchemaPaths, { name }); // eslint-disable-line no-use-before-define
      obj[name] = {
        name,
        fields,
        nonNull: false,
        type: 'Array',
        subtype: 'Object'
      };
    } else if (schemaPath instanceof mongoose.Schema.Types.Embedded) {
      schemaPath.modelName = schemaPath.schema.options.graphqlTypeName || name;
      // embedded model must be unique Instance
      const embeddedModel = embeddedModels.hasOwnProperty(schemaPath.modelName)
        ? embeddedModels[schemaPath.modelName]
        : getModel(schemaPath); // eslint-disable-line no-use-before-define

      embeddedModels[schemaPath.modelName] = embeddedModel;
      obj[name] = {
        ...getField(schemaPath),
        embeddedModel
      };
    } else if (key === subNames.length - 1) {
      obj[name] = getField(schemaPath);
    } else {
      obj[name] = {
        name,
        fields,
        nonNull: false,
        type: 'Object'
      };
    }

    return obj;
  }, {});
}
268399
protected function convertToUseRealPath($filePath)
    {
        $realFilePath = $filePath;

        if ($this->isZipStream($filePath)) {
            if (preg_match('/zip:\/\/(.*)#(.*)/', $filePath, $matches)) {
                $documentPath = $matches[1];
                $documentInsideZipPath = $matches[2];
                $realFilePath = 'zip://' . realpath($documentPath) . '#' . $documentInsideZipPath;
            }
        } else {
            $realFilePath = realpath($filePath);
        }

        return $realFilePath;
    }
14277
protected function _pathPrefix(EntityInterface $entity, $path, array $config) {
		return $this->_pathPreAndSuffix($entity, $path, $config, 'prefix');
	}
994283
public static function getRelativePathBetween($parentPath, $subPath)
    {
        if (self::isSubPathOf($parentPath, $subPath) === false) {
            throw new \InvalidArgumentException('Given path "' . $parentPath . '" is not the beginning of "' . $subPath .'", cannot get a relative path between them.', 1430075362);
        }

        return trim(substr($subPath, strlen($parentPath)), '/');
    }
297033
public function getModelFiles($path)
    {
        $fileCollection = new FileCollection();

        $namespacePath = str_replace('\\', '/', $path . $this->getNamespace() . '/');

        $targetPath = $namespacePath;

        foreach ($this->getEntities() as $entity) {
            if ($entity->getRenderizable()) {
                if ($this->getLanguage() === 'php') {
                    if ($entity->getNamespace() !== '') {
                        $targetPath = $path . str_replace('\\', '/', $entity->getNamespace()) . '/';
                    }
                } elseif ($this->getLanguage() === 'java') {
                    if ($entity->getModule() !== '') {
                        $targetPath = $path . '/' . $this->getAutocodeConfiguration('package') . '/' . str_replace('.', '/', $entity->getModule()) . '/';
                    }
                }

                foreach ($this->getAutocodeEntityTemplates() as $template) {
                    $fileCollection->add($this->renderEntityTemplate($template, $entity, $targetPath));
                }
            }
        }

        if ($this->getLanguage() === 'php') {
            foreach ($this->modules as $module) {
                $targetPath = $path . str_replace('\\', '/', $this->moduleNamespaces[$module]) . '/';

                foreach ($this->getAutocodeModuleTemplates() as $template) {
                    $fileCollection->add($this->renderModuleTemplate($this, $template, $module, $targetPath));
                }
            }
        }

        return $fileCollection;
    }
816601
private function getRouteName($entityClass, $routeType)
    {
        $this->init();

        if (isset($this->routeNames[$entityClass][$routeType])) {
            return $this->routeNames[$entityClass][$routeType];
        }

        $child = $entityClass;

        while ($parent = get_parent_class($child)) {
            if (isset($this->routeNames[$parent][$routeType])) {
                $this->routeNames[$entityClass][$routeType] = $this->routeNames[$parent][$routeType];

                return $this->routeNames[$entityClass][$routeType];
            }

            $child = $parent;
        }

        return null;
    }
420698
public function getEntitiesPath() {
    if (!isset($this->entitiesPath))
      $this->entitiesPath = Code::namespaceToPath($this->entitiesNamespace, $this->project->dir('lib'));
    
    return $this->entitiesPath;
  }
1200477
public function getEntityName($_route = null)
    {
        if($_route == null) {
            $request = $this->get('request_stack')->getCurrentRequest();
            $_route = $request->attributes->get('_route');
        }
        $parts = explode('.', $_route);
        if(count($parts) == 2) {
            $namespace = $parts[0];
        }
        $_route = end($parts);
        $parts = explode('_', $_route);
        if(count($parts) > 1) {
            $entity = $parts[count($parts)-2];
        } else {
            $parts = explode(':', $_route);
            if(count($parts) == 2) {
                $entity = strtolower($parts[1]);
            }
        }
        //if((count($parts)-2) == -1) die(var_dump($_route));
        //die(var_dump(count($parts)));
        //die(var_dump($entity));
        return $entity;
    }
117077
protected function _path(EntityInterface $entity, $path, array $config) {
		if ($config['modelFolder'] === true) {
			$path .= $entity->model . DS;
		}
		if ($config['randomPath'] === true) {
			$path .= $this->randomPath($entity->id);
		}
		if (is_string($config['randomPath'])) {
			$path .= $this->randomPath($entity->id, 3, $config['randomPath']);
		}
		// uuidFolder for backward compatibility
		if ($config['uuidFolder'] === true || $config['idFolder'] === true) {
			$path .= $this->stripDashes($entity->id) . DS;
		}

		return $path;
	}
1124009
protected function getModelNamespace($modelPath)
    {
        $appNamespace = trim($this->getAppNamespace(), '\\');
        $modelNamespace = str_replace('/', '\\', $appNamespace.'/'.ucfirst($modelPath));
        $modelNamespace = trim($modelNamespace, '\\');
        return $modelNamespace == 'App\\' ? 'App' : $modelNamespace;
    }
666529
public function getEntityNamespaceRootFromEntityReflection(
        ReflectionClass $entityReflection
    ): string {
        return $this->namespaceHelper->tidy(
            $this->namespaceHelper->getNamespaceRootToDirectoryFromFqn(
                $entityReflection->getName(),
                AbstractGenerator::ENTITIES_FOLDER_NAME
            )
        );
    }
128924
protected function getFullPath($contextPath, $targetPath): string
    {
        if ($this->filesystem->isAbsolutePath($targetPath)) {
            return $targetPath;
        }

        return rtrim($contextPath, '/\\').DIRECTORY_SEPARATOR.$targetPath;
    }
911803
public function getEntities($path)
    {
        $entities = [];

        $Directory = new \RecursiveDirectoryIterator($path);
        $Iterator = new \RecursiveIteratorIterator($Directory);
        $objects = new \RegexIterator($Iterator, '/.*(.php)$/', \RecursiveRegexIterator::GET_MATCH);

        foreach ($objects as $filename => $object) {
            $file = explode('/', $filename);
            if (!preg_filter($this->ignoredFolder, [], $file)) {
                $classname = $this->getNamespace($filename) . NAMESPACE_SEPARATOR . substr(basename($filename), 0, -4);
                if ($this->isValidNamespace($classname)) {
                    $entities[] = $classname;
                }
            }
        }

        return $entities;
    }