Exemplo n.º 1
0
 public function createCopie($ei_version_str, $conn = null)
 {
     $copie = null;
     try {
         //$conn->beginTransaction();
         //Création de la copie
         $copie = new EiFonction();
         $copie->setDescription($this->getDescription());
         $copie->setEiVersionStructure($ei_version_str);
         $copie->setFunctionId($this->getFunctionId());
         $copie->setFunctionRef($this->getFunctionRef());
         $copie->setProjectRef($this->getProjectRef());
         $copie->setProjectId($this->getProjectId());
         //Sauvegarde de la copie
         $copie->save($conn, false);
         $params = $this->getEiParams();
         if ($params->getFirst()) {
             foreach ($params as $i => $param) {
                 $param->createCopie($copie->getId(), $conn);
             }
         }
     } catch (Exception $e) {
         throw $e;
     }
     return $copie;
 }