allow to reassign timesheets from delete-user form (#2159)

This commit is contained in:
Kevin Papst
2020-12-03 22:52:58 +01:00
committed by GitHub
parent 4302ecd6ea
commit 0d2d40791a
6 changed files with 149 additions and 14 deletions

View File

@@ -22,6 +22,10 @@ final class UserFormTypeQuery extends BaseFormTypeQuery
* @var User[]
*/
private $includeUsers = [];
/**
* @var User[]
*/
private $ignoredUsers = [];
/**
* Sets a list of users which must be included in the result always.
@@ -45,4 +49,27 @@ final class UserFormTypeQuery extends BaseFormTypeQuery
{
return $this->includeUsers;
}
/**
* Given user will be excluded from the result set.
*
* @param User $user
* @return $this
*/
public function addUserToIgnore(User $user): UserFormTypeQuery
{
$this->ignoredUsers[] = $user;
return $this;
}
/**
* Returns the list of users that should not be loaded.
*
* @return User[]
*/
public function getUsersToIgnore(): array
{
return $this->ignoredUsers;
}
}