I'm serializing some data to save them in the database as serialized. Reason is because i dont want to create 30 columns in the database.
I've overriden the save
method and they are being saved successfuly as serialized string. Problem is how to fill the form fields upon editing the fields.
<field
name="tickets][price]"
type="text"
default=""
class="span6" />
How should i edit the loadFormData
or how to solve this ?
protected function loadFormData()
{
$data = JFactory::getApplication()->getUserState(
'com_buildings.edit.building.data',
array()
);
if (empty($data))
{
$data = $this->getItem();
$data->tickets = unserialize($data->tickets);
}
return $data;
}