implement cache managed by current object

This commit is contained in:
atm-greg 2022-04-05 15:10:31 +02:00
parent ad145c94ca
commit 59fec7d094
2 changed files with 5 additions and 3 deletions

View File

@ -3779,6 +3779,10 @@ abstract class CommonObject
{
global $conf, $hookmanager, $action;
// important for pdf generation time reduction
// this boolean is true if $this->linkedObjects has already been loaded with all objects linked without filter
if ($this->linkedObjectsFullLoaded) return 1;
$this->linkedObjectsIds = array();
$this->linkedObjects = array();

View File

@ -2282,9 +2282,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
$linkedobjects = array();
if (empty($object->linkedObjectsFullLoaded)) {
$object->fetchObjectLinked();
}
$object->fetchObjectLinked();
foreach ($object->linkedObjects as $objecttype => $objects) {
if ($objecttype == 'facture') {