asprin
Active member
So I've this piece of code in my controller method that handles form submission....
This results in only 1 row getting created into the db table and the other is always ignored. I tried putting
What am I missing here?
PHP:
protected function fooSaveProcess(\Asprin\FB\Entity\Foo $foo)
{
$formData = $this->filter('selections', 'array');
/*
count($formData) --> this is printing "2"
implode(",", $formData) --> this is printing "5,6"
so these two statements prove that there are two distinct values in the posted array
*/
/* now I'm attempting to loop through the array and create 2 records in the db */
foreach($formData as $selectionId)
{
$input = array();
$form = $this->formAction();
$input['column_name'] = $selectionId;
$form->basicEntitySave($foo, $input);
}
return $form;
}
This results in only 1 row getting created into the db table and the other is always ignored. I tried putting
$form = $this->formAction();
outside the for
loop and it still behaved the same way.What am I missing here?
Last edited: