N°2889 - Add placeholders for file data base64-encoded (simplifies many webhook calls)

This commit is contained in:
Molkobain
2023-02-17 11:12:44 +01:00
parent 0701f92143
commit d75805fb5e
2 changed files with 2 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ class EventListener implements iEventServiceSetup
'attachment->file_name' => $oDocument->GetFileName(),
'attachment->downloads_count' => $oDocument->GetDownloadsCount(),
'attachment->data' => $oDocument->GetData(),
'attachment->data_as_base64' => base64_encode($oDocument->GetData()),
];
$aTriggerParams = array('class_list' => MetaModel::EnumParentClasses($oAttachment->Get('item_class'), ENUM_PARENT_CLASSES_ALL));
$oTriggerSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT $sTriggerClass AS t WHERE t.target_class IN (:class_list)"), [], $aTriggerParams);

View File

@@ -67,6 +67,7 @@ class AttributeBlobEventListener implements iEventServiceSetup
'file->file_name' => $oDocument->GetFileName(),
'file->downloads_count' => $oDocument->GetDownloadsCount(),
'file->data' => $oDocument->GetData(),
'file->data_as_base64' => base64_encode($oDocument->GetData()),
);
$aTriggerParams = array('class_list' => MetaModel::EnumParentClasses(get_class($oObject), ENUM_PARENT_CLASSES_ALL));
$oTriggerSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT $sTriggerClass AS t WHERE t.target_class IN (:class_list)"), array(), $aTriggerParams);