ZfTable
ZfTable copied to clipboard
Doctrine 2 joining is fine but problem in displaying its value inside table.
$this->getHeader('city')->getCell()->addDecorator('callable', array(
'callable' => function($context, $record){
if(is_object($record->school_branches)){
echo "<pre>";
print_r($record->getSchoolBranches()[0]->getCity());
die;
return $record->getSchoolBranches()[0]->getCity();
}else{
return '';
}
}
));
print_r($record->getSchoolBranches()[0]->getCity()); // it prints correct value
but
return $record->getSchoolBranches()[0]->getCity(); //Fatal error: Call to a member function getCity() on a non-object in ...