ZfTable icon indicating copy to clipboard operation
ZfTable copied to clipboard

Doctrine 2 joining is fine but problem in displaying its value inside table.

Open utterly-calm opened this issue 9 years ago • 0 comments

$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 ...

utterly-calm avatar Dec 19 '15 18:12 utterly-calm