Beispiel #1
0
 /**
  * Constructs a new turn.
  *
  * @param iMatch The match being played
  * @param iTurn Last turn in match, null if this is the first turn
  **/
 public static function create(Match $match, Turn $last_turn = null)
 {
     $o = new Turn();
     $o->setMatch($match);
     $o->setStatus('open');
     if ($last_turn instanceof Turn) {
         $o->setStep($last_turn->getStep() + 1);
     }
     $o->save();
     return $o;
 }