original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Add a ConfigType If a ConfigType with this identifier already exists then it does nothing