Пример #1
0
 /**
  *
  * @param Parametrage $parametrage        	
  * @param Version $version        	
  * @param unknown $commentaire        	
  * @param unknown $path        	
  */
 protected function generateCollectiviteFile($parametrage, Version $version, $commentaire, $path)
 {
     $now = new DateTime();
     $now->format('d/m/Y H:i:s');
     $content = "#CREE AUTOMATIQUEMENT LE " . $now->format('d/m/Y H:i:s');
     $content .= "\n#Utilisateur : " . $version->getUser();
     // . "( " . $version->getUser ()->getEmail () . ")";
     $content .= "\n# Version V" . $version->getNumero();
     $content .= "\n# {$commentaire}";
     $content .= "\n#----------------------------- ";
     $content .= "\nLIBELLE=" . $parametrage->getLibelle();
     $content .= "\nORDRE=" . $parametrage->getOrdre();
     $content .= "\nPARTENAIRE=";
     $content .= in_array($parametrage->getPartenaires(), array('*', 'tous', 'Tous')) ? '*' : $parametrage->getPartenaires();
     $content .= "\nCOLLECTIVITES=";
     $content .= in_array($parametrage->getCollectivites(), array('*', 'toutes', 'Toutes')) ? '*' : $parametrage->getCollectivites();
     file_put_contents($path, $content);
 }
Пример #2
0
 /**
  * @param Parametrage $parametrage
  */
 public function setParametrage(Parametrage $parametrage)
 {
     $this->setIdParam($parametrage->getId());
     $this->setContrat($parametrage->getContrat());
     $this->setLibelle($parametrage->getLibelle());
     $this->setType($parametrage->getType());
     $this->setPartenaires($parametrage->getPartenaires());
     $this->setCollectivites($parametrage->getCollectivites());
     $this->setOrdre($parametrage->getOrdre());
     $this->setReference($parametrage->getReference());
     $this->setCreatedAt(new DateTime());
 }