Skip to content

Commit

Permalink
fix selection
Browse files Browse the repository at this point in the history
  • Loading branch information
fiste788 committed Oct 28, 2024
1 parent eee6901 commit 42722e7
Show file tree
Hide file tree
Showing 30 changed files with 530 additions and 488 deletions.
465 changes: 234 additions & 231 deletions composer.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/Application.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

/**
Expand Down
6 changes: 6 additions & 0 deletions src/Controller/SelectionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ function (Event $event): void {
$selection = $event->getSubject()->entity;
$selection->matchday_id = $this->currentMatchday->id;
$selection->active = true;

$this->Selections->updateQuery()->set(['active' => false])->where([
'team_id' => $selection->team_id,
'matchday_id' => $selection->matchday_id,
'active' => true,
]);
}
);

Expand Down
1 change: 0 additions & 1 deletion src/Model/Entity/Club.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace App\Model\Entity;
Expand Down
3 changes: 3 additions & 0 deletions src/Model/Entity/Selection.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace App\Model\Entity;
Expand Down Expand Up @@ -39,6 +40,8 @@ class Selection extends Entity
'new_member_id' => true,
'team_id' => true,
'matchday_id' => true,
'created_at' => false,
'modified_at' => false,
'old_member' => true,
'new_member' => true,
'team' => true,
Expand Down
22 changes: 11 additions & 11 deletions src/Model/Table/ArticlesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
* @property \App\Model\Table\TeamsTable&\Cake\ORM\Association\BelongsTo $Teams
* @property \App\Model\Table\MatchdaysTable&\Cake\ORM\Association\BelongsTo $Matchdays
* @method \App\Model\Entity\Article get(mixed $primaryKey, array|string $finder = 'all', \Psr\SimpleCache\CacheInterface|string|null $cache = null, \Closure|string|null $cacheKey = null, mixed ...$args)
* @method \App\Model\Entity\Article newEntity(array $data, array $options = [])
* @method \App\Model\Entity\Article[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\Article|false save(\Cake\Datasource\EntityInterface $entity, array $options = [])
* @method \App\Model\Entity\Article saveOrFail(\Cake\Datasource\EntityInterface $entity, array $options = [])
* @method \App\Model\Entity\Article patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\Article[] patchEntities(iterable $entities, array $data, array $options = [])
* @method \App\Model\Entity\Article findOrCreate($search, ?callable $callback = null, array $options = [])
* @method \App\Model\Entity\Article newEntity(array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Article[] newEntities(array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Article|false save(\Cake\Datasource\EntityInterface $entity, array<string, mixed> $options = [])
* @method \App\Model\Entity\Article saveOrFail(\Cake\Datasource\EntityInterface $entity, array<string, mixed> $options = [])
* @method \App\Model\Entity\Article patchEntity(\Cake\Datasource\EntityInterface $entity, array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Article[] patchEntities(iterable<\Cake\Datasource\EntityInterface> $entities, array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Article findOrCreate(\Cake\ORM\Query\SelectQuery|callable|array $search, ?callable $callback = null, array<string, mixed> $options = [])
* @method \App\Model\Entity\Article newEmptyEntity()
* @method \App\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface|false saveMany(iterable $entities, array $options = [])
* @method \App\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface saveManyOrFail(iterable $entities, array $options = [])
* @method \App\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface|false deleteMany(iterable $entities, array $options = [])
* @method \App\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface deleteManyOrFail(iterable $entities, array $options = [])
* @method \App\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Article>|false saveMany(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Article> saveManyOrFail(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Article>|false deleteMany(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Article> deleteManyOrFail(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @mixin \Cake\ORM\Behavior\TimestampBehavior
*/
class ArticlesTable extends Table
Expand Down
22 changes: 11 additions & 11 deletions src/Model/Table/ChampionshipsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
* @property \App\Model\Table\RollOfHonorsTable&\Cake\ORM\Association\HasMany $RollOfHonors
* @property \App\Model\Table\TeamsTable&\Cake\ORM\Association\HasMany $Teams
* @method \App\Model\Entity\Championship get(mixed $primaryKey, array|string $finder = 'all', \Psr\SimpleCache\CacheInterface|string|null $cache = null, \Closure|string|null $cacheKey = null, mixed ...$args)
* @method \App\Model\Entity\Championship newEntity(array $data, array $options = [])
* @method \App\Model\Entity\Championship[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\Championship|false save(\Cake\Datasource\EntityInterface $entity, array $options = [])
* @method \App\Model\Entity\Championship saveOrFail(\Cake\Datasource\EntityInterface $entity, array $options = [])
* @method \App\Model\Entity\Championship patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\Championship[] patchEntities(iterable $entities, array $data, array $options = [])
* @method \App\Model\Entity\Championship findOrCreate($search, ?callable $callback = null, array $options = [])
* @method \App\Model\Entity\Championship newEntity(array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Championship[] newEntities(array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Championship|false save(\Cake\Datasource\EntityInterface $entity, array<string, mixed> $options = [])
* @method \App\Model\Entity\Championship saveOrFail(\Cake\Datasource\EntityInterface $entity, array<string, mixed> $options = [])
* @method \App\Model\Entity\Championship patchEntity(\Cake\Datasource\EntityInterface $entity, array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Championship[] patchEntities(iterable<\Cake\Datasource\EntityInterface> $entities, array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Championship findOrCreate(\Cake\ORM\Query\SelectQuery|callable|array $search, ?callable $callback = null, array<string, mixed> $options = [])
* @method \App\Model\Entity\Championship newEmptyEntity()
* @method \App\Model\Entity\Championship[]|\Cake\Datasource\ResultSetInterface|false saveMany(iterable $entities, array $options = [])
* @method \App\Model\Entity\Championship[]|\Cake\Datasource\ResultSetInterface saveManyOrFail(iterable $entities, array $options = [])
* @method \App\Model\Entity\Championship[]|\Cake\Datasource\ResultSetInterface|false deleteMany(iterable $entities, array $options = [])
* @method \App\Model\Entity\Championship[]|\Cake\Datasource\ResultSetInterface deleteManyOrFail(iterable $entities, array $options = [])
* @method \App\Model\Entity\Championship[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Championship>|false saveMany(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\Championship[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Championship> saveManyOrFail(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\Championship[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Championship>|false deleteMany(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\Championship[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Championship> deleteManyOrFail(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
*/
class ChampionshipsTable extends Table
{
Expand Down
22 changes: 11 additions & 11 deletions src/Model/Table/ClubsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
*
* @property \App\Model\Table\MembersTable&\Cake\ORM\Association\HasMany $Members
* @method \App\Model\Entity\Club get(mixed $primaryKey, array|string $finder = 'all', \Psr\SimpleCache\CacheInterface|string|null $cache = null, \Closure|string|null $cacheKey = null, mixed ...$args)
* @method \App\Model\Entity\Club newEntity(array $data, array $options = [])
* @method \App\Model\Entity\Club[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\Club|false save(\Cake\Datasource\EntityInterface $entity, array $options = [])
* @method \App\Model\Entity\Club saveOrFail(\Cake\Datasource\EntityInterface $entity, array $options = [])
* @method \App\Model\Entity\Club patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\Club[] patchEntities(iterable $entities, array $data, array $options = [])
* @method \App\Model\Entity\Club findOrCreate($search, ?callable $callback = null, array $options = [])
* @method \App\Model\Entity\Club newEntity(array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Club[] newEntities(array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Club|false save(\Cake\Datasource\EntityInterface $entity, array<string, mixed> $options = [])
* @method \App\Model\Entity\Club saveOrFail(\Cake\Datasource\EntityInterface $entity, array<string, mixed> $options = [])
* @method \App\Model\Entity\Club patchEntity(\Cake\Datasource\EntityInterface $entity, array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Club[] patchEntities(iterable<\Cake\Datasource\EntityInterface> $entities, array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Club findOrCreate(\Cake\ORM\Query\SelectQuery|callable|array $search, ?callable $callback = null, array<string, mixed> $options = [])
* @method \App\Model\Entity\Club newEmptyEntity()
* @method \App\Model\Entity\Club[]|\Cake\Datasource\ResultSetInterface|false saveMany(iterable $entities, array $options = [])
* @method \App\Model\Entity\Club[]|\Cake\Datasource\ResultSetInterface saveManyOrFail(iterable $entities, array $options = [])
* @method \App\Model\Entity\Club[]|\Cake\Datasource\ResultSetInterface|false deleteMany(iterable $entities, array $options = [])
* @method \App\Model\Entity\Club[]|\Cake\Datasource\ResultSetInterface deleteManyOrFail(iterable $entities, array $options = [])
* @method \App\Model\Entity\Club[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Club>|false saveMany(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\Club[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Club> saveManyOrFail(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\Club[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Club>|false deleteMany(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\Club[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Club> deleteManyOrFail(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
*/
class ClubsTable extends Table
{
Expand Down
22 changes: 11 additions & 11 deletions src/Model/Table/DispositionsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
* @property \App\Model\Table\MembersTable&\Cake\ORM\Association\BelongsTo $Members
* @property \Cake\ORM\Table&\Cake\ORM\Association\HasOne $Rating
* @method \App\Model\Entity\Disposition get(mixed $primaryKey, array|string $finder = 'all', \Psr\SimpleCache\CacheInterface|string|null $cache = null, \Closure|string|null $cacheKey = null, mixed ...$args)
* @method \App\Model\Entity\Disposition newEntity(array $data, array $options = [])
* @method \App\Model\Entity\Disposition[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\Disposition|false save(\Cake\Datasource\EntityInterface $entity, array $options = [])
* @method \App\Model\Entity\Disposition saveOrFail(\Cake\Datasource\EntityInterface $entity, array $options = [])
* @method \App\Model\Entity\Disposition patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\Disposition[] patchEntities(iterable $entities, array $data, array $options = [])
* @method \App\Model\Entity\Disposition findOrCreate($search, ?callable $callback = null, array $options = [])
* @method \App\Model\Entity\Disposition newEntity(array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Disposition[] newEntities(array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Disposition|false save(\Cake\Datasource\EntityInterface $entity, array<string, mixed> $options = [])
* @method \App\Model\Entity\Disposition saveOrFail(\Cake\Datasource\EntityInterface $entity, array<string, mixed> $options = [])
* @method \App\Model\Entity\Disposition patchEntity(\Cake\Datasource\EntityInterface $entity, array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Disposition[] patchEntities(iterable<\Cake\Datasource\EntityInterface> $entities, array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\Disposition findOrCreate(\Cake\ORM\Query\SelectQuery|callable|array $search, ?callable $callback = null, array<string, mixed> $options = [])
* @method \App\Model\Entity\Disposition newEmptyEntity()
* @method \App\Model\Entity\Disposition[]|\Cake\Datasource\ResultSetInterface|false saveMany(iterable $entities, array $options = [])
* @method \App\Model\Entity\Disposition[]|\Cake\Datasource\ResultSetInterface saveManyOrFail(iterable $entities, array $options = [])
* @method \App\Model\Entity\Disposition[]|\Cake\Datasource\ResultSetInterface|false deleteMany(iterable $entities, array $options = [])
* @method \App\Model\Entity\Disposition[]|\Cake\Datasource\ResultSetInterface deleteManyOrFail(iterable $entities, array $options = [])
* @method \App\Model\Entity\Disposition[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Disposition>|false saveMany(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\Disposition[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Disposition> saveManyOrFail(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\Disposition[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Disposition>|false deleteMany(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\Disposition[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\Disposition> deleteManyOrFail(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
*/
class DispositionsTable extends Table
{
Expand Down
22 changes: 11 additions & 11 deletions src/Model/Table/LeaguesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
*
* @property \App\Model\Table\ChampionshipsTable&\Cake\ORM\Association\HasMany $Championships
* @method \App\Model\Entity\League get(mixed $primaryKey, array|string $finder = 'all', \Psr\SimpleCache\CacheInterface|string|null $cache = null, \Closure|string|null $cacheKey = null, mixed ...$args)
* @method \App\Model\Entity\League newEntity(array $data, array $options = [])
* @method \App\Model\Entity\League[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\League|false save(\Cake\Datasource\EntityInterface $entity, array $options = [])
* @method \App\Model\Entity\League saveOrFail(\Cake\Datasource\EntityInterface $entity, array $options = [])
* @method \App\Model\Entity\League patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\League[] patchEntities(iterable $entities, array $data, array $options = [])
* @method \App\Model\Entity\League findOrCreate($search, ?callable $callback = null, array $options = [])
* @method \App\Model\Entity\League newEntity(array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\League[] newEntities(array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\League|false save(\Cake\Datasource\EntityInterface $entity, array<string, mixed> $options = [])
* @method \App\Model\Entity\League saveOrFail(\Cake\Datasource\EntityInterface $entity, array<string, mixed> $options = [])
* @method \App\Model\Entity\League patchEntity(\Cake\Datasource\EntityInterface $entity, array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\League[] patchEntities(iterable<\Cake\Datasource\EntityInterface> $entities, array<mixed> $data, array<string, mixed> $options = [])
* @method \App\Model\Entity\League findOrCreate(\Cake\ORM\Query\SelectQuery|callable|array $search, ?callable $callback = null, array<string, mixed> $options = [])
* @method \App\Model\Entity\League newEmptyEntity()
* @method \App\Model\Entity\League[]|\Cake\Datasource\ResultSetInterface|false saveMany(iterable $entities, array $options = [])
* @method \App\Model\Entity\League[]|\Cake\Datasource\ResultSetInterface saveManyOrFail(iterable $entities, array $options = [])
* @method \App\Model\Entity\League[]|\Cake\Datasource\ResultSetInterface|false deleteMany(iterable $entities, array $options = [])
* @method \App\Model\Entity\League[]|\Cake\Datasource\ResultSetInterface deleteManyOrFail(iterable $entities, array $options = [])
* @method \App\Model\Entity\League[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\League>|false saveMany(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\League[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\League> saveManyOrFail(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\League[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\League>|false deleteMany(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
* @method \App\Model\Entity\League[]|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\League> deleteManyOrFail(iterable<\Cake\Datasource\EntityInterface> $entities, array<string, mixed> $options = [])
*/
class LeaguesTable extends Table
{
Expand Down
Loading

0 comments on commit 42722e7

Please sign in to comment.