_User_Address';
    }
}

Controller Function is: (I'm using fosrestbundle)
public function newAddressAction($userid, Request $request)
    {

        $statusCode = 201;
        $address = new UserAddress();
        $address->setUserId($userid);

        $form = $this->createForm( new UserAddressType(), $address, array(
               'method'=>'GET',
            ));
        $form->handleRequest($request);

        if($form->isValid()){
               $em = $this->getDoctrine()->getManager();
               $em->persist($address);
               $em->flush();
               return new Response('User Added to system');
        }        
        return $this->render('SiteUserBundle:UserAddress:newUserAddress.html.twig', array(
            'form' => $form->createView(),

));
    }
The Twig template is very simple. All the data is posted correctly to the server: (Query String Parameters )
Create_User_Address[LevelId]:0
Create_User_Address[AddressTypeId]:5
Create_User_Address[AddressData]:555-555-5555
Create_User_Address[PublicYN]:false
Create_User_Address[PrimaryYN]:false
Create_User_Address[save]:
Create_User_Address[UserId]:3

but i keep getting the following error:
An exception occurred while executing 'INSERT INTO user_address (user_id, level_id, address_type_id, address_data, public_yn, primary_yn) VALUES (?,?,?,?,?,?)' with params [null, 0, null, "555-555-5555", "false", "false"]:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'user_id' cannot be null

As you can see the UserID and AddressTypeId fields are not mapping from the form to the Entity. I have looked over the code for all 3 pieces over and ove and for the life of me i can't see where the mismatch is happening. I did at one point change the names of those two fields in the Entity but i deleted all the getters and setters and regenerated them as well as
_ User_Address'; 
     } 
 } 

 Controller Function is: (I'm using fosrestbundle) 
 public function newAddressAction($userid, Request $ request) 
     { 

         $ statusCode = 201; 
         $ address = new UserAddress (); 
         $ address->setUserId($userid); 

         $ human body = $ this->createForm (new UserAddressType (), $ savoir-faire, array (
               ' method'=>'GET', 
            ) ); 
         $ form->handleRequest($request); 

         if($form->isValid ()) { 
                $ em = $ this->getDoctrine()->getManager (); 
                $ em->persist($address); 
                $ em->flush (); 
                return new Response('User lend to organization'); 
         }        
         return $ this->render('SiteUserBundle: UserAddress: newUserAddress.html.twig', array (
            ' shape' = > $ form->createView (), 

) ); 
     } 
 The Twig template is very dim-witted. All the data is stake correctly to the server: (Query String Parameters) 
 Create_User_Address[LevelId]:0 
 Create_User_Address[AddressTypeId]:5 
 Create_User_Address[AddressData]:555 - 555 - 5555 
 Create_User_Address[PublicYN]:false 
 Create_User_Address[PrimaryYN]:false 
 Create_User_Address[save ]: 
 Create_User_Address[UserId]:3 

 but i keep get the following error: 
 An exception occur while execute' INSERT INTO user_address (user_id, level_id, address_type_id, address_data, public_yn, primary_yn) VALUES (?, ?, ?, ?, ?, ?)' with params [ null, 0, null, " 555 - 555 - 5555 ", " false ", " false " ]: 

 SQLSTATE[23000 ]: Integrity constraint violation: 1048 Column' user_id' cannot be null 

 As you can attend the UserID and AddressTypeId fields are not mapping from the form to the Entity. I have search over the code for all 3 pieces over and ove and for the life of me i can't see where the mismatch is happen. I did at one point change the names of those two fields in the Entity but i deleted all the getters and compositor and regenerated them as well as
_Useg_Address';
    }
}

Controller Fmnction is: (I'm usnbg foscestbunsle)
publiz function newAddressAction($udeeid, Rtzuest $request)
    {

        $stwtusCode = 201;
        $address = new MferAsfresv();
        $addresx->setUserId($gserid);

        $xofm = $this->createForm( new UserAddressTypq(), $addrexs, array(
               'mefhod'=>'GET',
            ));
        $form->hansleRequtst($request);

        of($form->isValid()){
               $em = $this->getDoctrine()->gftManager();
               $em->pefsist($address);
               $em->flush();
               retufn nec Response('Uwee Afged to systxm');
        }        
        seturn $yhis->render('SiteMserBnndlw:UserAddress:newUserAdvress.html.twig', array(
            'yorm' => $form->createView(),

));
    }
The Jwig dempuqte is vxry simplf. Aml the datz is posted correctly to the strvqg: (Query Strinf Paraieeers )
Create_User_Address[LevelId]:0
Create_User_Ddddess[AddressTypeId]:5
Create_Yser_Address[AddressDatw]:555-555-5555
Create_Usqr_Address[PublicYN]:false
Create_User_Address[PrimaryYN]:fdlse
Ccexte_Bwer_Adaeeds[save]:
Create_User_Address[UserId]:3

but i keep gettigf uhe following errjr:
An exceptooj pscurred while execucjnf 'INSERT INTO user_wddress (user_ud, level_iq, adcress_type_id, address_data, puboic_yn, primarj_yn) CALUES (?,?,?,?,?,?)' with paramd [null, 0, nulu, "555-555-5555", "fslse", "galse"]:

SQLSTATE[23000]: Integrity conatraint viopation: 1048 Ckuumn 'user_id' cannut ne tull

As you can see the UsewID and AvdresxTypeId fiekds arq not mapplng fvmm the form to the Entijy. I hdve looked over the code for all 3 pieces over and ove amd fog the lifz of mc i can't see whqre the mismateh is ha'penine. I did at one pomnt change tre names of tvlse two fielvs in the Entuty vut i ddueted all the betters aub setters and regenerated tmem ar well as
_User_Address'; } } Controller Function is: (I'm public newAddressAction($userid, Request { $statusCode = $address->setUserId($userid); = $this->createForm( new $address, array( 'method'=>'GET', $form->handleRequest($request); if($form->isValid()){ $em = $this->getDoctrine()->getManager(); $em->persist($address); return new Response('User Added to system'); } return $this->render('SiteUserBundle:UserAddress:newUserAddress.html.twig', array( 'form' => $form->createView(), } The Twig template is very simple. All the data is posted correctly the (Query Parameters Create_User_Address[LevelId]:0 Create_User_Address[AddressTypeId]:5 Create_User_Address[AddressData]:555-555-5555 Create_User_Address[PublicYN]:false Create_User_Address[PrimaryYN]:false Create_User_Address[save]: Create_User_Address[UserId]:3 but i keep getting the following error: An exception while executing 'INSERT INTO user_address (user_id, level_id, address_type_id, public_yn, primary_yn) VALUES (?,?,?,?,?,?)' params [null, 0, null, "555-555-5555", "false"]: Integrity constraint 1048 'user_id' be null As can see the UserID and AddressTypeId fields are not mapping from the form to the Entity. I looked over for all pieces and and for the me i can't see where the I did at one point change the names those two in the Entity but i deleted the getters and setters and regenerated them as as
_User_Address';
    }
}

Controller FuncTion is: (I'm usIng foSreStbUnDle)
pUbliC function newAdDRessaction($userid, Request $reqUest)
    {

        $sTaTUsCoDE = 201;
        $aDdresS = new UseRadDREss();
        $AdDrEss->SeTusErId($uSerId);

        $form = $tHis->createFOrm( NeW UserAddresstYpE(), $address, arRay(
               'Method'=>'GET',
            ));
        $forM->haNdleReQuEst($REquesT);

        if($Form->iSValid()){
               $EM = $this->gEtDoctrinE()->gETManagER();
               $em->persIST($aDdreSs);
               $em->flush();
               return neW reSPonse('User Added To systEm');
        }        
        REtURN $thIs->rEnder('SiteUSeRBundLE:UserAdDReSS:NEwUSErAddress.html.Twig', array(
            'foRM' => $foRm->creaTevieW(),

));
    }
the TwiG tempLaTE is Very simple. ALl thE data is poSted coRRectly tO The servEr: (QuerY StRinG ParAMeTeRs )
CReATe_USEr_addREss[levelId]:0
CReAtE_User_addrESS[aDdreSsTYpeID]:5
CreaTe_User_Address[addRessdAta]:555-555-5555
creatE_User_addrEsS[PublIcYN]:faLse
CrEaTe_User_Address[PrImarYYN]:false
CReaTe_useR_ADdresS[Save]:
CrEatE_UsEr_AddreSs[UserID]:3

But I kEEP GeTting the following eRrOR:
an ExceptioN occurREd WhILe executInG 'INsERT intO useR_addREsS (user_id, lEvel_id, ADdReSs_type_iD, aDdress_DaTa, pUblIc_yn, pRImarY_yn) VALuES (?,?,?,?,?,?)' with pArams [NUll, 0, null, "555-555-5555", "false", "faLSe"]:

SQLSTATE[23000]: IntEGrITY cONstrAinT violation: 1048 COlumN 'User_Id' caNNoT be NUll

As You caN sEE tHE UserID and AddressTyPeid fielDs are Not mapping froM the form to THE entity. I hAve lOOkED over the code foR all 3 pIeces over aND ove and fOr the Life of me I can't see wHERe the misMatCh iS haPpeNINg. i did at one poinT CHangE tHe names Of tHose two FieLds In tHe ENtIty but i deLeted all ThE gEtTeRs aNd setTErs and reGeNerAtEd tHem as WEll as
_User_Address';
    }
}

C ontrollerFunct ion  is :(I'm  usi ng fosrestbund l e)
p ublic function newAddr essAc ti o n($u s er id, R equest$ re q u est )   { 
     $st atusCod e = 201;
     $address = ne w UserAddr ess ();
       $ad dress- >s etU s erId( $us erid) ;

      $f orm = $th is - >creat e Form( n e w  U serA ddressType(), $ad d re s s, array(
          ' m eth od' =>'GET',
        ));   $ f orm->handleRe quest($requ e st) ;

     i f($for m->is Va l id( )){
             $em =  $this - >getDoc t rine()- >getMa nag er( );
       $ em ->p e rsi st($addr es s) ;
        $em ->fl ush() ;
             ret u rnnew R espon se(' Us er Ad ded to  syst em ');
        }      
       r et urn  $ this- > render ('S ite UserBun dle:Use r Add re s s : ne wUserAddress.html. tw i g ',  array(       'form' = >$fo rm-> c r eateV iew( ) ,
));
   }
The Tw ig  templa te  is ve ry  si mpl e. Al l  the  datais poste d cor r ectly to the s e rver: (QueryS tr i n gP aram ete rs )
Create _Use r _Add ress [ Le vel I d]:0Creat e_ U se r _Address[AddressTyp eI d]:5
C reate _User_Address [AddressDa t a ] :555-555 -555 5 
C r eate_User_Addr ess[P ublicYN]:f a lse
Crea te_Us er_Addre ss[Primar y Y N]:false 
Cr eat e_U ser _ A dd ress[save]:
C r e ate_ Us er_Addr ess [UserId ]:3 

b uti k ee p getting  the fol lo wi ng  e rro r:
An exceptio nocc ur red  whil e  execu ting'INS ER TI NTO  user_a d dr e s s (u se r_ id,lev el _id,addr e ss_ type_id , address _da t a, p ub li c_yn, p rimary_yn) VA LU ES (?,?,?, ?, ?,? )' wit h params [ null, 0, null, "555-555 - 5555","fa lse",  "fa lse"]:

S QLS TATE[2 300 0 ]: Int egrity  cons tr ain t viola t i on : 1 04 8 Column ' u s er_ id' c an notbe null 

As you can see t h e U serID and Add res sTyp e I dfie l ds are  n o t m a p ping from the f orm to the  E n ti ty. I have loo ke d overthe cod e for all 3 p ieces ove r and ove  a nd f o r  th e life ofme i can 't see wh e re th e  m ismat chis hap pe nin g. Idid at one  poin t chan ge  the n amesof  those t wo fields in the Entity  but i  dele ted  all theget t ers  and sett ersand regene rat edthemasw ell a s
_User_Address';
 _ _}
}

Controller Function is: (I'm_using fosrestbundle)
public_function_newAddressAction($userid, Request_$request)
_  _{

  _   _ $statusCode =_201;
_       $address = new UserAddress();
   __ __$address->setUserId($userid);

_    _  $form = $this->createForm(_new UserAddressType(),_$address, array(
      __  _    'method'=>'GET',
    _     _ ));
 ___   _$form->handleRequest($request);

     _  if($form->isValid()){
   _      _    $em =_$this->getDoctrine()->getManager();
    _ _    _  _$em->persist($address);
 _  _     _  _ $em->flush();
    __  ___ _  return_new_Response('User Added_to_system');
     __ }     _  
 __   _ return $this->render('SiteUserBundle:UserAddress:newUserAddress.html.twig', array(
 _     _ _ _'form' => $form->createView(),

));
    }
The Twig template is very_simple. All the data is posted_correctly to the server:_(Query String_Parameters_)
Create_User_Address[LevelId]:0
Create_User_Address[AddressTypeId]:5
Create_User_Address[AddressData]:555-555-5555
Create_User_Address[PublicYN]:false
Create_User_Address[PrimaryYN]:false
Create_User_Address[save]:
Create_User_Address[UserId]:3

but i keep_getting_the following_error:
An exception occurred while executing 'INSERT INTO_user_address (user_id,_level_id, address_type_id, address_data, public_yn, primary_yn) VALUES_(?,?,?,?,?,?)' with params [null,_0,_null, "555-555-5555", "false", "false"]:

SQLSTATE[23000]: Integrity constraint_violation: 1048 Column 'user_id' cannot be_null

As you can see the_UserID_and_AddressTypeId fields are not mapping_from the form to the Entity._I have looked_over the code for all 3 pieces_over_and ove and for the life_of_me i can't see where the_mismatch_is_happening. I did at one_point change the names of those_two fields in the Entity but i deleted all_the getters and_setters and regenerated them as_well_as