Exemplo n.º 1
0
 /**
  * @param Handicap $handicap
  * @return HandicapListDTO
  */
 public function toHandicapListDTO(Handicap $handicap)
 {
     $handicapListDTO = new HandicapListDTO();
     $handicapListDTO->id = $handicap->getId();
     $handicapListDTO->name = $handicap->getName();
     return $handicapListDTO;
 }
Exemplo n.º 2
0
 /**
  * @param $name
  * @param null $memo
  * @return Handicap
  */
 public static function registerHandicap($name, $memo = null)
 {
     $handicap = new Handicap();
     $handicap->setName($name);
     $handicap->setMemo($memo);
     return $handicap;
 }
Exemplo n.º 3
0
 private function createHandicap($name)
 {
     $handicap = Handicap::registerHandicap($name);
     $current = $this->init->handicapRepo->findOneBy(array('name' => $name));
     if (empty($current)) {
         $this->init->handicapRepo->store($handicap);
         return $handicap;
     }
     return $current;
 }