Skip to content

ORM toArray() throwing exception on null related entity #279

Description

@ossigeno

Description

In Mako 7.0.0 a null related entity throws exception when toArray() called on parent object.
Exception is: Call to a member function toArray() on null

...

Steps to reproduce


Create an object that can have a child object
In model for parent object set $including to include the child object
Let the related object be null.
Convert parent object to array.

ORM is throwing error in toArray() here:
$columns += [$relation => ($related === false ? $related : $related->toArray())];
...

Versions & Platform


What Version
PHP Version 7.5.0
Mako Version 7.0.0
OS MacOS
Database MariaDb

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions