Jarves\Router\RestApiLoader::setupWindowRoute PHP Метод

setupWindowRoute() публичный Метод

public setupWindowRoute ( EntryPoint $entryPoint )
$entryPoint Jarves\Configuration\EntryPoint
    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);
    }