Skip to content

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

@utterly-calm

Description

@utterly-calm
$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 ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions