You can access the fields on a model object in the following ways: $post->field_name; $post->attributes['field_name']; If you need an array of the fields on a model object, do this: $data = $post->attributes;
Beispiel #1
0
 public function parse(&$data)
 {
     // Use the parent parse
     $ret =& parent::parse($data);
     // figure out where the id is
     if (!empty($ret['userblog_id'])) {
         $ret['id'] =& $ret['userblog_id'];
         unset($ret['userblog_id']);
     } else {
         if (!empty($ret['blog_id'])) {
             $ret['id'] =& $ret['blog_id'];
             unset($ret['blog_id']);
         }
     }
     return $ret;
 }