Jarves\JarvesBundle::registerFieldTypes PHP Method

registerFieldTypes() protected method

protected registerFieldTypes ( Jarves $jarves, Symfony\Component\DependencyInjection\ContainerInterface $container )
$jarves Jarves
$container Symfony\Component\DependencyInjection\ContainerInterface
    protected function registerFieldTypes(Jarves $jarves, ContainerInterface $container)
    {
        foreach ($jarves->getConfigs() as $bundleConfig) {
            if ($bundleConfig->getFieldTypes()) {
                foreach ($bundleConfig->getFieldTypes() as $fieldType) {
                    if ($fieldType->isUserInterfaceOnly()) {
                        continue;
                    }
                    if (!$fieldType->getService()) {
                        throw new \RuntimeException(sprintf('For field type %s:%s is no service defined. If it does not handle model related persisting, ' . 'you should add interface-only="true"', $bundleConfig->getName(), $fieldType->getId()));
                    }
                    if (!$container->has($fieldType->getService())) {
                        throw new \RuntimeException(sprintf('Service `%s` for field type %s:%s does not exist', $fieldType->getService(), $bundleConfig->getName(), $fieldType->getId()));
                    }
                    $jarves->getFieldTypes()->addType($fieldType->getId(), $fieldType->getService());
                }
            }
        }
    }