Jarves\Jarves::getFieldTypes PHP Method

getFieldTypes() public method

public getFieldTypes ( ) : FieldTypes
return Jarves\Admin\FieldTypes\FieldTypes
    public function getFieldTypes()
    {
        return $this->fieldTypes;
    }

Usage Example

Ejemplo n.º 1
0
 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());
             }
         }
     }
 }