Welcome Guest, Not a member yet? Register   Sign In
changing object in loop in Datamapper ORM to save
#1

[eluser]mak.gnu[/eluser]
I'm trying to save a long form in Codeigniter's Datamapper. I'm able to save the form if I pass the value like this
Code:
$t->brandName = $this->input->post('brandName');  
$t->specialNotes = $this->input->post('specialNotes');
$t->name = $this->input->post('name')
;

Now if I call the save method it works fine.

$t->save();

Since the form is big I tried to add object values in foreach
Code:
$a = get_object_vars($t);
foreach ($a['stored'] as $k => $val){
      $t->$k = $this->input->post("$k");
}

however if I call the $t->save() it doesn't work.
Any input into this.


Messages In This Thread
changing object in loop in Datamapper ORM to save - by El Forum - 05-11-2011, 12:20 PM
changing object in loop in Datamapper ORM to save - by El Forum - 05-12-2011, 05:43 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 02:30 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 02:36 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 05:00 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 06:37 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 08:46 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 08:57 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 09:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB