libpairtwo/src/Tournament.php

34 lines
597 B
PHP
Raw Normal View History

2019-02-01 15:53:39 +01:00
<?php
/**
* Created by PhpStorm.
* User: jeroen
* Date: 1/02/19
* Time: 11:18
*/
namespace JeroenED\Libpairtwo;
use JeroenED\Libpairtwo\Models\Tournament as TournamentModel;
class Tournament extends TournamentModel
{
/**
* @param Integer $id
* @return Player
*/
public function getPlayerById($id)
{
return $this->GetPlayers()[$id];
}
/**
* @param Player $Player
*/
public function addPlayer(Player $Player)
{
$newArray = $this->GetPlayers();
$newArray[] = $Player;
$this->setPlayers($newArray);
}
}