Exemplo n.º 1
0
 public function __construct(Dashboard $dashboard)
 {
     $this->id = $dashboard->getId();
     $this->creationDate = $dashboard->getCreationDate();
     $this->name = $dashboard->getName();
     $this->gadgetContainer = new GadgetContainerEntity($dashboard->getGadgetContainer());
 }
Exemplo n.º 2
0
 public function getAccountDashboard(AccountInterface $account)
 {
     $dashboard = null;
     $dashboardId = $account->getProperty('dashboard');
     if ($dashboardId) {
         $repository = $this->entityManager->getRepository(DashboardEntity::class);
         $dashboard = $repository->find($dashboardId);
     }
     if (!$dashboard) {
         $dashboard = new DashboardEntity('Dashboard ' . $account->getContact()->getDisplayName());
         $account->setProperty('dashboard', $dashboard->getId()->toString());
         $this->entityManager->persist($dashboard);
         $this->entityManager->flush();
     }
     return $dashboard;
 }