allow to reassign timesheets from delete-user form (#2159)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user