public function addType($identifier, $label, $formType, $options = array())
    {
        $typeManager = $this->container->get('admin.configuration.configtype_manager');
        $type = $typeManager->getRepository()->findOneByIdentifier($identifier);
        if (!$type) {
            $type = new ConfigType();
            $type->setIdentifier($identifier);
            $type->setTLabel($label);
            $type->setFormType($formType);
            if ( is_array($options) && count($options) ) {
                $type->setOptions(json_encode($options));
            }
            $typeManager->create($type);

            return true;
        }

        return false;
    }
public function addType($identifier, $label, $formType, $options = array())
    {
        $typeManager = $this->container->get('admin.configuration.configtype_manager');
        $type = $typeManager->getRepository()->findOneByIdentifier($identifier);
        if (!$type) {
            $type = new ConfigType();
            $type->setIdentifier($identifier);
            $type->setTLabel($label);
            $type->setFormType($formType);
            if ( is_array($options) && count($options) ) {
                $type->setOptions(json_encode($options));
            }
            $typeManager->create($type);

            return true;
        }

        return false;
    }
public function addType ( $ identifier , $ label , $ formType , $ options = array ( ) ) { $ typeManager = $ this -> container -> get ( 'admin.configuration.configtype_manager' ) ; $ type = $ typeManager -> getRepository ( ) -> findOneByIdentifier ( $ identifier ) ; if ( ! $ type ) { $ type = new ConfigType ( ) ; $ type -> setIdentifier ( $ identifier ) ; $ type -> setTLabel ( $ label ) ; $ type -> setFormType ( $ formType ) ; if ( is_array ( $ options ) && count ( $ options ) ) { $ type -> setOptions ( json_encode ( $ options ) ) ; } $ typeManager -> create ( $ type ) ; return true ; } return false ; }
Add a ConfigType
If a ConfigType with this identifier already exists then it does nothing

@param string $identifier Type identifier
@param string $label      Type label
@param string $formType   Form type
@param array  $options    Form options

@return boolean
Add a ConfigType If a ConfigType with this identifier already exists then it does nothing