title: POMM2 in Symfony3 project, trouble with registering converter
body: <p>The idea is this. In table 'driver' I have fields that describe 'driver', but I need to store another set of fields about 100 which I didn't need to be table columns. So I decided to store them in Jsonb field. I need to be able to work with this fields as model fields, but they need to be automatically saved in one jsonb field.. and when I select from a table I need this field to be shown like other fields from the table.</p>
  
  <p>I have checked documentation about converters and found PgJson converter. So I think that this is the right tool to deal with this problem, but I didn't manage to configure things the right way so far.</p>
  
  <p>I have tried to register field 'testinfo' as type 'extrainfo' which is registered as a converter in SessionBuilder, but have no success. Methods fromPg and toPG are not called. Here I show examples from my project files.</p>
  
  <p>composer.json</p>
  
  <pre><code>...
  "require": {
      "php": "&gt;=7.0.0",
      ...
      "pomm-project/pomm-bundle": "^2.3",
      "sensio/distribution-bundle": "^5.0.19",
      "sensio/framework-extra-bundle": "^3.0.2",
      ...
      "symfony/symfony": "3.3.6",
      ...
      "vibby/pomm-project-fos-user-bundle": "dev-master"
  },
  ...
  </code></pre>
  
  <hr>
  
  <pre><code>CREATE TABLE public.driver
  (
    driver_id bigint NOT NULL DEFAULT nextval('driver_driver_id_seq'::regclass),
    account_id integer NOT NULL,
    infodata jsonb, -- large number of fields,...
    weight jsonb, -- weights for fields that are not in jsonb field
    ssn character varying,
    signature character varying
    -- ...
  )
  </code></pre>
  
  <hr>
  
  <p>config.yml</p>
  
  <pre><code>pomm:
  configuration:
      driversdb:
          dsn: "pgsql://%db_user2%:%db_password2%@%db_host2%:%db_port2%/%db_name2%"
          #session_builder: "pomm.session_builder"
          pomm:default: true
          session_builder: 'AppBundle\Model\Driversdb\SessionBuilder'
  </code></pre>
  
  <hr>
  
  <p>services.yml</p>
  
  <pre><code>...
  drivertojson:
      class: AppBundle\Service\DriverToJson
      tags:
          - { name: pomm.model, converter: pomm.model }
  
  AppBundle\Model\Driversdb\SessionBuilder:
      autowire: true
  ...
  </code></pre>
  
  <hr>
  
  <p>/src/AppBundle/Model/Driversdb/SessionBuilder.php</p>
  
  <pre><code>namespace AppBundle\Model\Driversdb;
  
  use AppBundle\Service\DriverToJson;          //Exact Copy of Pomm PgJson converter.
  use PommProject\Foundation\Converter\PgJson;
  use PommProject\Foundation\Session\Session;
  use PommProject\ModelManager\SessionBuilder as BaseSessionBuilder;
  
  class SessionBuilder extends BaseSessionBuilder
  {
      protected function postConfigure(Session $session) {
          parent::postConfigure($session);
  
          $session
              -&gt;getPoolerForType('converter')
              -&gt;getConverterHolder()
              -&gt;registerConverter('extrainfo', new DriverToJson(), ['infodata', 'public.driver.infodata']) // register Jsonb converter
              -&gt;addTypeToConverter('extrainfo', 'extrainfo', false) // convert a domain of point
          ;
      }
  }
  </code></pre>
  
  <hr>
  
  <p>/src/AppBundle/Model/Driversdb/PublicSchema/Driver.php</p>
  
  <pre><code>namespace AppBundle\Model\Driversdb\PublicSchema;
  
  use PommProject\ModelManager\Model\FlexibleEntity;
  
  /**
   * Driver
   * Flexible entity for relation
   * public.driver
   * @see FlexibleEntity
  */
  class Driver extends FlexibleEntity
  {
      public $keyForId = 'driver_id';
  
      public function getId() {
          return $this-&gt;get($this-&gt;keyForId);
      }
  
      public function __toString() {
          return $this-&gt;getSsn();
      }
  
      private $driver_id;
      private $account_id;
      private $infodata;
      private $weight;
      private $ssn;
      private $signature;
      //...
      private $testinfo;
  
      public function getTestinfo() {
          if ($this-&gt;has('testinfo')) {
              return $this-&gt;get('testinfo');
          } else {
              return '';
          }
      }
  
      public function getDriverId() {
          if ($this-&gt;has('driver_id')) {
              return $this-&gt;get('driver_id');
          } else {
              return '';
          }
      }
  
      public function getAccountId() {
          if ($this-&gt;has('account_id')) {
              return $this-&gt;get('account_id');
          } else {
              return '';
          }
      }
  //...
  </code></pre>
  
  <hr>
  
  <p>/src/Appbundle/Controller/DriverController.php</p>
  
  <pre><code>namespace AppBundle\Controller;
  
  use AppBundle\Form\DriverFormType;
  use AppBundle\Model\Driversdb\PublicSchema\Driver;
  use AppBundle\Model\Driversdb\PublicSchema\DriverModel;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Symfony\Component\Form\Exception\InvalidArgumentException;
  use Symfony\Component\HttpFoundation\Request;
  use AppBundle\Service\DriverToJson;
  
  class DriverController extends Controller
  {
  //...
  /**
       * @Route("/driver", name="driver_create")
       * @Method ("POST")
       * @Template("@App/Driver/new.html.twig")
       * @param Request $request
       * @return \Symfony\Component\HttpFoundation\RedirectResponse
       * @throws \Exception
       */
      public function createAction(Request $request){
          $driver = new Driver();
          $form = $this-&gt;createForm(DriverFormType::class, $driver,[
              'action'=&gt; $this-&gt;generateUrl('driver_create'),
              'method'=&gt; 'POST'
          ]);
  
          $form-&gt;handleRequest($request);
          if($form-&gt;isValid()){
              $driver = $form-&gt;getData();
              try{
                  /** @var DriverModel $driverModel */
                  $driverModel = $this-&gt;get('pomm')['driversdb']-&gt;getModel(DriverModel::class);
                  $driverModel-&gt;insertOne($driver);
                  return $this-&gt;redirectToRoute('driver_list');
              }catch (\Exception $e){
                  throw $e;
              }
          }
          throw new InvalidArgumentException('Invalid form data');
      }
  //...
  }
  </code></pre>
  
  <hr>
  
  <p>/src/AppBundle/Form/DriverFormType.php</p>
  
  <pre><code>namespace AppBundle\Form;
  
  use AppBundle\Model\Driversdb\PublicSchema\Driver;
  use AppBundle\Service\DriverToJson;
  use PommProject\Foundation\Converter\ConverterPooler;
  use PommProject\PommBundle\Request\ParamConverter\EntityParamConverter;
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\Extension\Core\Type\TextType;
  use Symfony\Component\Form\FormBuilderInterface;
  use Symfony\Component\OptionsResolver\OptionsResolver;
  
  class DriverFormType extends AbstractType
  {
      public function buildForm(FormBuilderInterface $builder, array $options){
          $builder
              -&gt;add('testinfo', 'extrainfo', array('mapped'=&gt;false))
              -&gt;add('account_id', TextType::class)
              -&gt;add('ssn', TextType::class,array(
                  'attr'  =&gt; [
                      'class' =&gt; 'col-xs-12'
                  ]
              ))
             // ... many other fields.
          ;
      }
  
      public function configureOptions(OptionsResolver $resolver) {
          $resolver-&gt;setDefaults([
              'data_class'=&gt; Driver::class,
              'attr'=&gt;array('novalidate'=&gt;'novalidate'),
          ]);
      }
  }
  </code></pre>