public function isFull() { $count = PlayerTable::getInstance()->findByTournamentId($this->getId())->count(); if ($this->getNumberOfTeams() <= 0) { return false; } if ($count >= $this->getNumberOfTeams() * $this->getPlayersPerTeam()) { return true; } return false; }
protected function getPlayersFromFilterQuery() { $holder = $this->getUser()->getAttributeHolder()->getAll('admin_module'); $query = PlayerTable::getInstance()->createQuery(); if (isset($holder['player.filters'])) { $parameters = $holder['player.filters']; $form = new PlayerNoCSRFFormFilter($parameters); $form->setQuery($query); $form->bind($parameters); if ($form->isValid()) { $query = $form->getQuery(); // apply filters to the query } } return $query; }