-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,193 additions
and
1,241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace App\Controller\Leagues; | ||
|
||
use App\Controller\AppController; | ||
use Authorization\Exception\ForbiddenException; | ||
use Cake\Event\EventInterface; | ||
use Psr\Http\Message\ResponseInterface; | ||
|
||
/** | ||
* @property \App\Model\Table\ChampionshipsTable $Championships | ||
*/ | ||
class ChampionshipsController extends AppController | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* @throws \Authorization\Exception\ForbiddenException | ||
*/ | ||
public function beforeFilter(EventInterface $event): void | ||
{ | ||
parent::beforeFilter($event); | ||
$leagueId = (int)$this->request->getParam('league_id'); | ||
/** @var \App\Model\Entity\User $identity */ | ||
$identity = $this->Authentication->getIdentity(); | ||
if (!$identity->isInLeague($leagueId)) { | ||
throw new ForbiddenException(); | ||
} | ||
} | ||
|
||
/** | ||
* Index | ||
* | ||
* @return \Psr\Http\Message\ResponseInterface | ||
* @throws \Crud\Error\Exception\ActionNotConfiguredException | ||
* @throws \Exception | ||
*/ | ||
public function index(): ResponseInterface | ||
{ | ||
/** @var \Crud\Action\IndexAction $action */ | ||
$action = $this->Crud->action(); | ||
$action->findMethod(['byLeagueId' => [ | ||
'league_id' => (int)$this->request->getParam('league_id'), | ||
]]); | ||
|
||
return $this->Crud->execute(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace App\Model\Entity; | ||
|
||
use Cake\ORM\Entity; | ||
|
||
/** | ||
* RollOfHonor Entity | ||
* | ||
* @property int $team_id | ||
* @property int $championship_id | ||
* @property int $league_id | ||
* @property float|null $points | ||
* @property int|null $rank | ||
* | ||
* @property \App\Model\Entity\Member $member | ||
*/ | ||
class RollOfHonor extends Entity | ||
{ | ||
/** | ||
* Fields that can be mass assigned using newEntity() or patchEntity(). | ||
* | ||
* Note that when '*' is set to true, this allows all unspecified fields to | ||
* be mass assigned. For security purposes, it is advised to set '*' to false | ||
* (or remove it), and explicitly make individual fields accessible as needed. | ||
* | ||
* @var array<string, bool> | ||
*/ | ||
protected array $_accessible = [ | ||
|
||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.