예제 #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());
 }
예제 #2
0
파일: Dashboard.php 프로젝트: zource/zource
 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;
 }