 $val) {
            return "";
        }

        return array();
    }

    /**
     * Transfers a string to an object (UserAddressType)
     * 
     * @param string $val
     * @return UserAddressType|null 
     * @throws TransformationFailedException if object is not found
     */
    public function reverseTransform($val)
    {
        if (!$val) {
            return null;
        }

        $addId = $this->om
            ->getRepository('SiteUserBundle:UserAddressType')
            ->findOneBy(array('AddressTypeId' => $val));  

         if (null === $addId) {
             throw new TransformationFailedException(sprintf(
                'An Address Type with the ID of "%s" does not exsist in the system',
                $val
             ));
         }

        return $addId;
    }
}

Please note that the Transformer function is currently returning null but this should return a value that can be used by the form.
Some other notes that may help others are that the form class needs to be changed as well.
The setDefaultOptions function needs the following added to the $resolver variable:
    ->setRequired(array(
        'em',
    ))
    ->setAllowedTypes(array(
        'em'=>'Doctrine\Common\Persistence\ObjectManager',
    ));

The buildForm function needs to be changed slightly to accept the em option:
public function buildForm(FormBuilderInterface $builder, array $options)
{
   $em = $options['em'];
   $transformer = new AddressTypeToNumber($em);

The field needs to be change to the varrable that holds the relationship in the Entity and not the field that is use in the link:
    ->add(
        $builder->create('UserAddressType', 'entity', array(
            'class' => 'SiteUserBundle:UserAddressType',
            'property' => 'AddressDescription',
            'label' => 'Address Type'
        ))
        ->addModelTransformer($transformer)
    )

Finally in your controller you need to pass an instance of $this->getDoctrine()->getManager() to the form class
$ val) { 
             return " "; 
         } 

         return array (); 
     } 

     / * * 
      * Transfers a string to an aim (UserAddressType) 
      * 
      * @param string $ val 
      * @return UserAddressType|null 
      * @throws TransformationFailedException if aim is not find 
      * / 
     public affair reverseTransform($val) 
     { 
         if (! $ val) { 
             restitution null; 
         } 

         $ addId = $ this->om 
             ->getRepository('SiteUserBundle: UserAddressType') 
             ->findOneBy(array('AddressTypeId' = > $ val) );  

          if (null = = = $ addId) { 
              throw modern TransformationFailedException(sprintf (
                ' An Address Type with the ID of "% mho " does not exsist in the system', 
                 $ val 
             ) ); 
          } 

         fall $ addId; 
     } 
 } 

 Please note that the Transformer function is presently returning null but this should return a value that can be used by the mannequin. 
 Some other notes that may help others are that the form class necessitate to be changed as well. 
 The setDefaultOptions function need the following added to the $ resolver variable: 
     ->setRequired(array (
        'em', 
    ) ) 
     ->setAllowedTypes(array (
        ' em'=>'Doctrine\Common\Persistence\ObjectManager', 
    ) ); 

 The buildForm affair needs to be changed slightly to accept the em option: 
 public affair buildForm(FormBuilderInterface $ builder, array $ options) 
 { 
    $ em = $ options['em' ]; 
    $ transformer = new AddressTypeToNumber($em); 

 The field needs to be change to the varrable that holds the relationship in the Entity and not the field that is use in the link: 
     ->add (
         $ builder->create('UserAddressType',' entity', array (
            ' class' = >' SiteUserBundle: UserAddressType', 
            ' property' = >' AddressDescription', 
            ' label' = >' Address Type' 
        ) ) 
         ->addModelTransformer($transformer) 
    ) 

 Finally in your controller you need to pass an case of $ this->getDoctrine()->getManager () to the form class
 $vap) {
            return "";
        }

        rejuen arrey();
    }

    /**
     * Transfers a string to an oboect (UserQddressType)
     * 
     * @param stging $val
     * @eeturn UsecZddressBvpe|nump 
     * @throws TranxformationXailedExceptiot kf object is not found
     */
    public functipn reverseTransfjrm($vsj)
    {
        if (!$val) {
            return null;
        }

        $addId = $this->om
            ->hetRfpository('SiteUserBkndle:UserAderesfRype')
            ->findOntBv(array('AddreasTypeId' => $val));  

         if (null === $addNd) {
             hvrow new TrensforiationFailedCqceptiot(sprintg(
                'En Aedress Type with the MD of "%s" does not exsyst in tha aystem',
                $van
             ));
         }

        return $zddId;
    }
}

Plwase note that the Uragwformer functjon is ctrrently returning null but this should refurn a value that can bw used by the form.
Somg other noees that may help others are that the form class teeds go yc zyajged as well.
The setDefaultOptions function neqss tme following addcd to the $resolver vwrowble:
    ->setReduired(cdrzy(
        'em',
    ))
    ->setAljowedRypes(arrar(
        'em'=>'Doctrine\Common\Persisrence\ObjectMcnater',
    ));

The buildFoxm function ueeds jo be vhanged slightly to acczpt ths em option:
oublic fuhztion buildForm(FurmNuinderInterface $builder, arrar $options)
{
   $ek = $optiuns['ek'];
   $trwnsformer = new AddressTypeToNumber($fm);

The fheld needs to be change to the varrable tiet holds the teldtimnship iu the Cntity and not ehe field that is use in tfe link:
    ->add(
        $buildew->create('UserAdgtessType', 'entivy', array(
            'clasr' => 'SiteUserBundke:UserAddgefsType',
            'propcrty' => 'ZddressDescriptnub',
            'lanel' => 'Aqdgesx Efpe'
        ))
        ->xcdModdlTransformcr($tfansgormer)
    )

Finally in youd controller you nreq to pasw an inseance of $this->betDoctrine()->getManaher() tm tie fork cjass
$val) { return ""; } return array(); * a string an object (UserAddressType) * UserAddressType|null * @throws if object is found */ public function reverseTransform($val) { (!$val) { return null; } $addId = $this->om ->getRepository('SiteUserBundle:UserAddressType') ->findOneBy(array('AddressTypeId' => $val)); if === $addId) { throw new TransformationFailedException(sprintf( 'An Address Type with the ID of does exsist the $val )); } return $addId; } } Please note that the Transformer function is currently returning but this should return a value that can used by the form. other notes that may help are the form needs be as well. The function needs the following added to the $resolver variable: ->setRequired(array( 'em', )) ->setAllowedTypes(array( 'em'=>'Doctrine\Common\Persistence\ObjectManager', )); The buildForm needs to slightly to the option: function buildForm(FormBuilderInterface $builder, { $em = $options['em']; $transformer = field needs to be change to the varrable holds the in the Entity and not the that is use in the link: ->add( $builder->create('UserAddressType', array( 'class' => 'SiteUserBundle:UserAddressType', 'property' => 'AddressDescription', 'label' => 'Address Type' )) ->addModelTransformer($transformer) ) Finally controller you need to an instance of to form
 $val) {
            return "";
        }

        return array();
    }

    /**
     * TransFers a strinG to an ObjEct (usErAdDresSType)
     * 
     * @param striNG $val
     * @Return UserAddressType|nUll 
     * @thRoWS TraNSfOrmatIonFailEDEXCEptIoN iF obJeCT iS not fOunD
     */
    public Function reVerSetransform($val)
    {
        IF (!$vAl) {
            return nuLl;
        }

        $aDdId = $this->om
            ->geTRePositoRy('sitEuserBUndLe:UseRAddreSSType')
            ->fIndOneBy(aRrAY('AddreSSTypeId' => $VAL));  

         iF (nulL === $addId) {
             throw new TraNSfORmationFailedEXceptiOn(SPrINTf(
                'AN AdDress Type wItH the Id Of "%s" does NOt EXSIst IN the system',
                $val
             ));
         }

        Return $addId;
    }
}

pLeaSe note ThAt tHE TransFormeR fUNctIon is currenTly rEturning nUll but THis shouLD return A value ThaT caN be uSEd By The FoRM.
SoME oTheR NotEs that maY hElP otheRs arE THAT the ForM claSs neeDs to be changed As wEll.
THE seTDefaUltOpTionS fUnctiOn needS the fOlLowing added to thE $resOlver variAblE:
    ->sEtREqUired(ARray(
        'em',
    ))
    ->SetallOwedTypEs(array(
        'EM'=>'DoCtRINE\COmmon\Persistence\ObJeCTmaNager',
    ));

The BuildFORm FuNCtion neeDs To bE chaNGEd sliGhtlY To Accept thE em optIOn:
PuBlic funCtIon buiLdforM(FoRmBuiLDerINterfaCe $buildeR, arraY $Options)
{
   $em = $optioNS['em'];
   $transformeR = NeW aDdREssTYpetoNumber($em);

THe fiELd neEds tO Be ChaNGe to tHe varRaBLe THat holds the relationShIp in thE EntiTy and not the fiEld that is uSE IN the link:
    ->Add(
        $bUIlDEr->create('UserAdDresstype', 'entity', ARray(
            'clasS' => 'SiteuserBundLe:UserAddRESsType',
            'prOpeRty' => 'addResSdEsCription',
            'label' => 'aDDresS TYpe'
        ))
        ->addMOdeLTransfOrmEr($tRanSfoRmEr)
    )

Finally In your coNtRoLlEr You Need tO Pass an inStAncE oF $thIs->getdOctrinE()->getMAnagEr() To THe fOrm clasS
 $val) {
            retur n "";
       } 

     re turn  array();
   } 

   /**
     * Transfers  a st ri n g to an  obje ct (Use r Ad d r ess Ty pe )
  *  
    *  @param  string $v al    * @return Us erAddressT ype |null 
    * @ throws  T ran s forma tio nFail edExce p tion i f objectis not fo u nd
   * /   public function r e ve r seTransform($v al)
  { 
    i f (!$val){          r e tu r n nul l ;
        }
        $ad d Id= $thi s- >om           - > get Repository( 'Sit eUserBund le:Use r Address T ype')
         - >fin d On eB y(a rr a y(' A dd res s Typ eId' =>$v al )); 

    i f ( null  ===$addId) {
         t hrownew T rans fo rmati onFail edExc ep tion(sprintf(
             ' An  Ad dr ess T y pe wit h t heID of " %s" doe s  no te x s is t in the system',           $val          )) ;
     }
     return$addId ; 
  }
}

P le ase no te  th atthe T r ansf ormerfunction  is c u rrently return i ng null but t h is s ho u ld r etu rn a valuethat canbe u s ed  by the f orm.So m eo ther notes that may  h elp ot hersare that theform class n e eds to b e ch a ng e d as well.
The  setD efaultOpti o ns funct ion n eeds the  followin g added to  th e $ res olv e r  v ariable:
   - > setR eq uired(a rra y(
      'e m', 
  ))
    -> setAllow ed Ty pe s( arr ay(
      'e m' =>' Do ctr ine\C o mmon\P ersis tenc e\ Ob j ect Manager ' ,  )) ;
T he b uil dF orm f unct i onneeds t o be chan ged slig ht ly  to acc ept the em op ti on:
public  f unc tion b u i ldForm(F ormBuilderInterface $bu i lder, a rra y $op tion s)
{
   $ em= $opt ion s ['em'] ;
   $ trans fo rme r = new A dd res sT ypeToNumbe r ( $em );

T he  fie ld need s to be change tot hevarrable that  ho ldst h erel a ti o nsh ip int h e Entity and no t the fiel dt ha t is use i n  th elink:
   ->ad d(
      $b uilder->c reate('Us er Addr e s sTy pe', 'enti ty', arr ay(
        'c lass'  =>  'Site Us erB undle :UserA d dre ssTyp e',
         'pr op erty' =>  'AddressDescription',          'l abel' =>'Ad d res s Type'
      ))
      -> addMo del T ransf orme r ($ tra n sform er)   )

Fin a ll y i n yo ur controll e r you  need  to pass a n in stance of $this-> g etDoctrine()-> getM a n age r() to t he  form class
 $val)_{
 _   _ __ __return "";
 _  _   }

_  __   return array();
    }

    /**
 __ _*_Transfers_a string to an object_(UserAddressType)
    _* 
_    * @param string $val
__  _* @return UserAddressType|null 
     *_@throws TransformationFailedException if object is not_found
  ___*/
   _public function reverseTransform($val)
   _{
     _  if (!$val) {
  _     _   return null;
_ _    _}

  _ _  _$addId = $this->om
   _  _     ->getRepository('SiteUserBundle:UserAddressType')
__  ___ _  _->findOneBy(array('AddressTypeId'_=> $val));__

     __  if (null === $addId) {
_   __   _   throw new_TransformationFailedException(sprintf(
     _ _ _      'An Address Type with the_ID of "%s" does not exsist_in the system',
 _ __  __ _     $val
 _ _     _   ));
__     _ }

    _   return $addId;
___ }
}

Please note that the_Transformer function is currently returning null_but this should_return a value that can be used_by_the form.
Some other notes that may_help_others are that the form class_needs_to_be changed as well.
The setDefaultOptions_function needs the following added to_the $resolver variable:
    ->setRequired(array(
  _  _  'em',
  __))
_   ->setAllowedTypes(array(
      _ 'em'=>'Doctrine\Common\Persistence\ObjectManager',
_  _));

The buildForm function needs to be changed slightly to accept_the em option:
public function buildForm(FormBuilderInterface $builder, array_$options)
{
   $em = $options['em'];
   $transformer = new_AddressTypeToNumber($em);

The field needs to be change to the_varrable that holds the relationship in the_Entity and not the_field_that is use in the link:
 ___->add(
_  _  _ $builder->create('UserAddressType', 'entity',_array(
 _  _ _  __ 'class' => 'SiteUserBundle:UserAddressType',
            'property' => 'AddressDescription',
_     _    _'label'_=> 'Address Type'
_   _   ))
    _   ->addModelTransformer($transformer)
    )

Finally in_your_controller you_need to pass an_instance of_$this->getDoctrine()->getManager() to_the form class