added multi-select for customer, project and activity (#1557)

This commit is contained in:
Kevin Papst
2020-03-16 14:06:26 +01:00
committed by GitHub
parent 6eeb01ad48
commit 4b1cfa5840
74 changed files with 1262 additions and 754 deletions

View File

@@ -9,14 +9,50 @@
namespace App\Repository\Query;
use App\Entity\User;
class TeamQuery extends BaseQuery
{
public const TEAM_ORDER_ALLOWED = ['id', 'name', 'teamlead'];
/**
* @var User[]
*/
private $users = [];
public function __construct()
{
$this->setDefaults([
'orderBy' => 'name',
]);
}
public function hasUsers(): bool
{
return !empty($this->users);
}
public function addUser(User $user): self
{
$this->users[$user->getId()] = $user;
return $this;
}
public function removeUser(User $user): self
{
if (isset($this->users[$user->getId()])) {
unset($this->users[$user->getId()]);
}
return $this;
}
/**
* @return User[]
*/
public function getUsers(): array
{
return array_values($this->users);
}
}