catch (\InvalidArgumentException
) { continue;
} if (!
$relationData) { continue;
} if ($relationData instanceof EntityCollection
) { /** @var Entity $sub */
foreach ($relationData as $sub) { $this->
serializeEntity($fields,
$sub,
$relationship['tmp'
]['definition'
],
$result, true
);
} continue;
} $this->
serializeEntity($fields,
$relationData,
$relationship['tmp'
]['definition'
],
$result, true
);
} $record->
setRelationships($relationships);
}