3 e. Reader boilerplate
Jeroen De Meerleer edited this page 2019-09-28 10:24:18 +02:00
<?php

use DateTime;
use JeroenED\Libpairtwo\Enums\Color;
use JeroenED\Libpairtwo\Enums\Tiebreak;
use JeroenED\Libpairtwo\Enums\TournamentSystem;
use JeroenED\Libpairtwo\Enums\Gender;
use JeroenED\Libpairtwo\Enums\Title;
use JeroenED\Libpairtwo\Enums\Result;
use JeroenED\Libpairtwo\Exceptions\IncompatibleReaderException;
use JeroenED\Libpairtwo\Interfaces\ReaderInterface;
use JeroenED\Libpairtwo\Pairing;
use JeroenED\Libpairtwo\Player;
use JeroenED\Libpairtwo\Round;
use JeroenED\Libpairtwo\Tournament;

class MyReader implements ReaderInterface
{
    /** @var Tournament */
    private $Tournament;

    /**
     * @return Tournament
     */
    public function getTournament(): Tournament
    {
        return $this->Tournament;
    }

    /**
     * @param Tournament $Tournament
     */
    public function setTournament(Tournament $Tournament)
    {
        $this->Tournament = $Tournament;
    }
    
    public function read($filename): ReaderInterface
    {
        $tournament = new Tournament();
        // Reading out of fields
        $this->setTournament($tournament);
    }
}