Jarves\Configuration\EntryPoint::getFullPath PHP Method

getFullPath() public method

public getFullPath ( ) : string
return string
    public function getFullPath()
    {
        if (null === $this->fullPath) {
            $path[] = $this->getPath();
            $instance = $this;
            while ($instance = $instance->getParentInstance()) {
                if (!$instance instanceof EntryPoint) {
                    break;
                }
                array_unshift($path, $instance->getPath());
            }
            array_unshift($path, $this->getBundle()->getName());
            $this->fullPath = implode('/', $path);
        }
        return $this->fullPath;
    }

Usage Example

コード例 #1
0
ファイル: RestApiLoader.php プロジェクト: jarves/jarves
 public function setupWindowRoute(EntryPoint $entryPoint)
 {
     $class = $entryPoint->getClass();
     if (!class_exists($class)) {
         throw new ClassNotFoundException(sprintf('Class `%s` not found in entryPoint `%s`', $class, $entryPoint->getFullPath()));
     }
     /** @var $importedRoutes \Symfony\Component\Routing\RouteCollection */
     $importedRoutes = $this->import($class, 'annotation');
     $classReflection = new \ReflectionClass($class);
     $objectKey = $classReflection->getDefaultProperties()['object'];
     $object = $this->jarves->getObjects()->getDefinition($objectKey);
     if (!$object) {
         throw new ObjectNotFoundException(sprintf('Object `%s` in entryPoint `%s` of class `%s` not found.', $objectKey, $entryPoint->getFullPath(), $class));
     }
     $pattern = $entryPoint->getFullPath();
     $this->addEntryPointRoutes($importedRoutes, $pattern, $object);
 }