users weekly stats as bar-chart in dashboard (#847)

This commit is contained in:
Kevin Papst
2019-06-13 18:38:49 +02:00
committed by GitHub
parent e1f862507e
commit 3311f17bbb
96 changed files with 2754 additions and 846 deletions

View File

@@ -10,7 +10,7 @@
namespace App\Event;
use App\Entity\User;
use App\Model\DashboardSection;
use App\Widget\WidgetContainerInterface;
use Symfony\Component\EventDispatcher\Event;
class DashboardEvent extends Event
@@ -22,41 +22,31 @@ class DashboardEvent extends Event
*/
protected $user;
/**
* @var DashboardSection[]
* @var WidgetContainerInterface[]
*/
protected $widgetRows = [];
/**
* @param User $user
*/
public function __construct(User $user)
{
$this->user = $user;
}
/**
* @return User
*/
public function getUser()
public function getUser(): User
{
return $this->user;
}
/**
* @param DashboardSection $row
* @return DashboardEvent
*/
public function addSection(DashboardSection $row)
public function addSection(WidgetContainerInterface $container): DashboardEvent
{
$this->widgetRows[] = $row;
$this->widgetRows[] = $container;
return $this;
}
/**
* @return DashboardSection[]
* @return WidgetContainerInterface[]
*/
public function getSections()
public function getSections(): array
{
return $this->widgetRows;
}