added team permissions (#996)

This commit is contained in:
Kevin Papst
2019-08-16 01:22:33 +02:00
committed by GitHub
parent 9611646bc6
commit 561ec3b1e9
124 changed files with 4122 additions and 362 deletions

View File

@@ -9,6 +9,9 @@
namespace App\Repository\Query;
use App\Entity\Team;
use App\Entity\User;
/**
* Base class for advanced Repository queries.
*/
@@ -44,6 +47,45 @@ class BaseQuery
* @var string
*/
private $resultType = self::RESULT_TYPE_PAGER;
/**
* @var User
*/
private $user;
/**
* @var Team[]
*/
private $teams = [];
public function addTeam(Team $team): self
{
$this->teams[$team->getId()] = $team;
return $this;
}
/**
* @return Team[]
*/
public function getTeams(): array
{
return array_values($this->teams);
}
public function getCurrentUser(): ?User
{
return $this->user;
}
/**
* @param User $user
* @return $this
*/
public function setCurrentUser(User $user)
{
$this->user = $user;
return $this;
}
/**
* @return int