public function __construct(School $school, User $user) { $userYear = $user->getLastLogin()->format('Y'); $schoolId = $school->getId(); $this->schoolId = $schoolId; $this->userYear = $userYear; }
/** * Add schools * * @param \Pouce\UserBundle\Entity\School $schools * @return Edition */ public function addSchool(\Pouce\UserBundle\Entity\School $schools) { $this->schools[] = $schools; $schools->setEdition($this); //Ajout de la génération pour ne pas boucler à l'infinie (SdZ p.215) return $this; }