Skip to content

Instantly share code, notes, and snippets.

@robawtic
robawtic / Bracket
Created December 1, 2016 15:59
I am trying to avoid query the database x times to get the match participant data displayed. I would like to be able to do something like $match->home->player->blah. From within Bracket.php the fucntion getMatches returns the Matches but has no relations which is where I think all this would be solved.
<?php
namespace frontend\lib;
use frontend\models\Tournament;
use frontend\models\TournamentParticipant;
use frontend\models\TournamentMatch;
class Bracket {