You could do something like this:
$db = array(
"InfoPacked" => "Text",
);
function getInfo() {
return unserialize($this->InfoPacked);
}
function onBeforeWrite() {
$this->InfoPacked = serialize($this->Info);
parent::onBeforeWrite();
}
....
$myObj = new ObjClass();
$myObj->Info = array('a' => 1, 'b' => 2, 'c' => 3);
$myObj->Info['b']++;
$myObj->write();
I'd recommend using onBeforeWrite() rather than setInfo(), because
otherwise I don't think "$myObj->Info['b']++;" would work.
You could probably make a class, SerializedField..
class SerializedField extends DBField implements CompositeDBField { }
Except then you'd probably be looking to do something like this,
because $myObj->Info would return a SerializedField instance.
$myObj->Info->data = array('a' => 1, 'b' => 2, 'c' => 3)