The code snippet is as below:
$test = new PartnerRestrictionTransfer();
foreach($data as $data2)
{
$data = $test->setProductSku($data2);
}
print_r($data);die;
The code snippet is as below:
$test = new PartnerRestrictionTransfer();
foreach($data as $data2)
{
$data = $test->setProductSku($data2);
}
print_r($data);die;
You require to create new object every-time you get new value for $data2 variable. Also for readability you can use different name for your object variable.
Below is the updated code:
foreach($data as $data2)
{
$test = new PartnerRestrictionTransfer();
$var[data1] = $test->setProductSku($data2);
}
print_r($var);die;