limit amount of items in calendar drag and drop boxes (#2291)

This commit is contained in:
Kevin Papst
2021-07-11 15:03:18 +02:00
committed by GitHub
parent 2583fdf20e
commit a1f90ffaba
13 changed files with 178 additions and 82 deletions

View File

@@ -23,10 +23,15 @@ final class CalendarDragAndDropSourceEvent extends Event
* @var DragAndDropSource[]
*/
private $sources = [];
/**
* @var int
*/
private $maxEntries = 0;
public function __construct(User $user)
public function __construct(User $user, int $maxEntries)
{
$this->user = $user;
$this->maxEntries = $maxEntries;
}
public function getUser(): User
@@ -34,6 +39,11 @@ final class CalendarDragAndDropSourceEvent extends Event
return $this->user;
}
public function getMaxEntries(): int
{
return $this->maxEntries;
}
public function addSource(DragAndDropSource $source): CalendarDragAndDropSourceEvent
{
$this->sources[] = $source;