示例#1
0
 /**
  * Crée un nouveau format de fichier
  * @param string $contentType
  * @param string $nom
  * @param boolean $enable
  * @return fileFormat
  */
 public function createNewFormat($contentType, $nom = null, $enable = true)
 {
     $newFormat = new fileFormat();
     $newFormat->setEnabled($enable);
     $newFormat->setContentType($contentType);
     if (!is_string($nom)) {
         $nom = $contentType;
     }
     $newFormat->setNom($nom);
     $this->em->persist($newFormat);
     $this->em->flush();
     return $newFormat;
 }