1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| /**
* @Service("note_saver")
*/
class NoteSaver {
private $em;
/**
* @InjectParams({"em" = @Inject("doctrine.orm.entity_manager")})
*/
public function __construct(EntityManager $entityManager)
{
$this->em= $entityManager;
}
public function addNoteForName($note, $name) {
$note =new Note();
$note->setNote($note); //c'est bizar comme nommage mais bon
$c = new Candidat();
$c->setNom($nom);
$note->setCandidat($c);
$this->em->persist($note);
$this->em->flush();
return $note
} |
Partager