Within the following code, $quiz_object->personalities contains an array of Personality objects.
// Loop through each personality th
just thought I'd throw this in there for those using phpStorm.
I found the way to get the IDE to auto-populate the methods for an object was by including a quick if check beforeheand checking that the object exists and that the $var was an instance of said object.
Example:
foreach ($objArray as $obj) {
if (is_object($obj) && $obj instanceof DataObject) {
$obj->thisMethodShouldBeAvailableInPHPStormNow();
}
Found this question while searching for a better way, but the above works for me.
Cheers!