You assume that var $serialize = "my_group";
will do anything useful, but AFAIK it doesn't.
But I think this is an easy one:
We could have a table with a metadata_array column. Then we declare
function setMetadata($value)
{
$this->set('metadata_array',serialize($value));
}
function getMetadata()
{
return unserialize($this->get('metadata_array'));
}
in the model. We now have a transparent or virtual attribute.
$metadata = array('keywords'=>array('some','tags','here'),'descriptor'=>'xml-stuff');
$Model->setMetadata($metadata); // or:
$Model->set('metadata',$metadata); // or:
$Model->create(array(...,'metadata'=>$metadata));
1 to 2 of 2