NEW Add hook hookGetEntity.

Change name and param of hook
This commit is contained in:
Laurent Destailleur
2021-08-28 14:51:49 +02:00
parent 9bed2557f5
commit 0e38e1e2c4
2 changed files with 6 additions and 5 deletions

View File

@@ -104,7 +104,7 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port)
*/
function getEntity($element, $shared = 1, $currentobject = null)
{
global $conf, $mc, $hookmanager, $object;
global $conf, $mc, $hookmanager, $object, $action;
// fix different element names (France to English)
switch ($element) {
@@ -129,12 +129,13 @@ function getEntity($element, $shared = 1, $currentobject = null)
// Manipulate entities to query on the fly
$parameters = array(
'object' => $object,
'currentobject' => $currentobject,
'element' => $element,
'shared' => $shared,
'object' => $object,
'currentobject' => $currentobject,
'out' => $out
);
$reshook = $hookmanager->executeHooks('functionGetEntity', $parameters, $out, $element); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('hookGetEntity', $parameters, $currentobject, $action); // Note that $action and $object may have been modified by some hooks
if (is_numeric($reshook)) {
if ($reshook == 0 && !empty($hookmanager->resprints)) {