Code Kings
Published in

Code Kings

Phalcon 4 | PHP 7 -> AH00052: child pid 11 exit signal Segmentation fault (11) error? This is why…

Brett Jordan

The Issue

This is a quick post that will save you a ton of time trying to figure out what is going on.

When I was trying to pull some records from the model, I came across this error. The reason this is happening, is because you cannot use a magic getter method on the model that has been set to hasMany, because you are returning a result set that is an array of objects instead of simply an object as you would

The Solution

Change from this:

$model = ExampleModel::find();
$records = $model->getRelatedModel();

To this:

$model = ExampleModel::find();
$records = [];
foreach($model as $result){
$records[] = $result->getRelatedModel();

Then you should be good to go.

Happy Coding!




Programming tips & tricks from professionals

Recommended from Medium

“Doesn’t That Feel Better?”

How to root Fly IQ300

Root LG Phone

Time Complexity calculation of iterative programs

OOP In JAVA (Object-Oriented Programming)

inCitu May 2021 Pilot: Manhattan Community Board Five’s evaluation of future densities to the…

How to write Programmatic Queries — JPA Criteria API

Sub-Netting in Data Communication and Computer Networks

Programming Doesn’t Require Talent or Even Passion

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tony Mucci

Tony Mucci

Founder of My Company Tools • Co-Founder/CTO of Dree • Co-Founder of Eklect Enterprises. Opinions on this blog are my own.

More from Medium

All about uploading large amounts of data to S3 in Node.js

Node.js and Express: A Lightweight Minimalist Framework

How to create a custom UPSERT method in your controller to keep yourself DRY

Getting started with debugging express NodeJS app in VSCODE