Commit 0e93555d authored by Juan Manuel Solaro's avatar Juan Manuel Solaro

(feat) add additional data for push notifications

1 merge request!363WIP: (feat) add additional data for push notifications
Pipeline #88530222 failed with stages
in 8 minutes and 46 seconds
......@@ -176,10 +176,22 @@ class Events
$parentGuid = method_exists($entity, 'getEntityGuid') ? $entity->getEntityGuid() : $entity->parent_guid;
$parent = Entities\Factory::build($parentGuid, [ 'cache' => false ]);
if ($parent && method_exists($parent, 'getGuid')) {
$parent_info = [];
if ($parent) {
if (method_exists($parent, 'getGuid')) {
$parent_info[ 'parent_guid' ] = $parent->getGuid();
}
if (method_exists($parent, 'getType')) {
$parent_info[ 'parent_type' ] = $parent->getType();
}
}
if (!empty($parent_info)) {
$notification->setData(array_merge(
$notification->getData() ?: [],
[ 'parent_guid' => $parent->getGuid() ]
$parent_info
));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment