Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ossigeno opened this issue Sep 15, 2020 · 1 comment
Closed

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

ossigeno opened this issue Sep 15, 2020 · 1 comment
Assignees
Labels

Comments

@ossigeno
Copy link

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
@freost freost self-assigned this Sep 15, 2020
@freost freost added the bug label Sep 15, 2020
@freost
Copy link
Member

freost commented Sep 15, 2020

Thanks 👍 Fixed in 7.0.1

@freost freost closed this as completed Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants