public function toArray() { $data = $this->data()->getAll(); $arr = parent::toArray(); return array_merge($data, $arr); }
protected function recordToArray(Am_Record $rec) { $ret = $rec->toArray(); if (!empty($rec->_nested_)) { foreach ($rec->_nested_ as $table => $slaveRecords) { foreach ($slaveRecords as $slaveRecord) { $ret['nested'][$table][] = $slaveRecord->toArray(); } } } return $ret; }