<?php require_once 'vendor/autoload.php'; $steve = new Sopra\Entity\Contact(); $steve->setPrenom('Steve')->setNom('Jobs'); $apple = new Sopra\Entity\Societe(); $apple->setNom('Apple'); $steve->setSociete($apple); // Vue echo $steve->getPrenom() . "\n"; echo $steve->getNom() . "\n"; echo $steve->getSociete()->getNom() . "\n";
<?php require_once 'vendor/autoload.php'; $logger = new \Sopra\Logger\FileLoggerAvecInterface('tmp/app.log'); $logger->alert('Un message grave'); $contact = new \Sopra\Entity\Contact(); $societe = new \Sopra\Entity\Societe(); $contact->setLogger($logger); $contact->setSociete($societe);