Skip to content

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

@ossigeno

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

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions