forked from Wavyzz/dolibarr
NEW add new function "setEntity()"
This commit is contained in:
@@ -75,7 +75,7 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port)
|
||||
* @param int $shared 0=Return id of current entity only,
|
||||
* 1=Return id of current entity + shared entities (default)
|
||||
* @param object $currentobject Current object if needed
|
||||
* @return mixed Entity id(s) to use
|
||||
* @return mixed Entity id(s) to use
|
||||
*/
|
||||
function getEntity($element, $shared = 1, $currentobject = null)
|
||||
{
|
||||
@@ -95,6 +95,26 @@ function getEntity($element, $shared = 1, $currentobject = null)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get entity id to use when to create an object
|
||||
*
|
||||
* @param object $currentobject Current object
|
||||
* @return mixed Entity id to use
|
||||
*/
|
||||
function setEntity($currentobject)
|
||||
{
|
||||
global $conf, $mc;
|
||||
|
||||
if (is_object($mc))
|
||||
{
|
||||
return $mc->setEntity($currentobject);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $conf->entity;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return information about user browser
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user