您能否建议如何解决以下错误:
ErrorException [ Fatal Error ]: Cannot use object of type Model_Branch as array
请看控制器:
public function action_view($agent_id='') {
$agent = ORM::factory('agent', $agent_id);
if ($agent->loaded()) {
$values = $agent->as_array();
$branches = $agent->branches->find_all()->as_array();
// Show page
$this->template->title = $agent->company_name;
$this->template->content = View::factory('agent/view')
->bind('title', $this->template->title)
->bind('values', $values)
->bind('branches', $branches);
} else {
Request::instance()->redirect('agent');
}
}