Exemplo n.º 1
0
 /**
  * @param Team $team
  * @return Trainer
  */
 public function generateTrainer(Team $team)
 {
     $data = Factory::create();
     $trainer = new Trainer();
     $trainer->setAge($data->numberBetween(40, 60));
     $trainer->setCountry($data->country);
     $trainer->setName($data->name);
     $trainer->setTeam($team);
     return $trainer;
 }
Exemplo n.º 2
0
 /**
  * @param Trainer $trainer
  * @return $this
  */
 public function addTrainer(Trainer $trainer)
 {
     $trainer->setTeam($this);
     $this->trainers->add($trainer);
     return $this;
 }