dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] Error in invoice clone


From: Sébastien
Subject: Re: [Dolibarr-dev] Error in invoice clone
Date: Wed, 04 Sep 2013 14:33:38 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8

Yes it's ok for me.

Le 04/09/2013 12:44, Laurent Destailleur (eldy) a écrit :
Le 04/09/2013 07:32, Sébastien a écrit :
function __clone()
     {
         // Force a copy of this->lines, otherwise it will point to
same object.
         for($i=0; $i < count($this->lines); $i++){
             $this->lines[$i] = clone $this->lines[$i];
         }
     }
So we should have this __clone function for all objects that has ->lines
array.
I tried to add into the commonobject.class.php

     function __clone()
     {
         // Force a copy of this->lines, otherwise it will point to same
object.
         if (isset($this->lines) && is_array($this->lines))
         {
             for($i=0; $i < count($this->lines); $i++)
             {
                 $this->lines[$i] = dol_clone($this->lines[$i]);
             }
         }
     }

Is it ok for you ?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]