public function __construct(Cursus $cursus)
 {
     $details = [];
     $details['id'] = $cursus->getId();
     $details['title'] = $cursus->getTitle();
     $details['code'] = $cursus->getCode();
     $details['blocking'] = $cursus->isBlocking();
     $details['details'] = $cursus->getDetails();
     $details['root'] = $cursus->getRoot();
     $details['lvl'] = $cursus->getLvl();
     $details['lft'] = $cursus->getLft();
     $details['rgt'] = $cursus->getRgt();
     $parent = $cursus->getParent();
     $course = $cursus->getCourse();
     $workspace = $cursus->getWorkspace();
     if (!is_null($parent)) {
         $details['parentId'] = $parent->getId();
         $details['parentTitle'] = $parent->getTitle();
         $details['parentCode'] = $parent->getCode();
     }
     if (!is_null($course)) {
         $details['courseId'] = $course->getId();
         $details['courseTitle'] = $course->getTitle();
         $details['courseCode'] = $course->getCode();
     }
     if (!is_null($workspace)) {
         $details['workspaceId'] = $workspace->getId();
         $details['workspaceName'] = $workspace->getName();
         $details['workspaceCode'] = $workspace->getCode();
         $details['workspaceGuid'] = $workspace->getGuid();
     }
     parent::__construct(self::ACTION, $details);
 }
 public function __construct(Cursus $cursus, User $user)
 {
     $details = [];
     $details['username'] = $user->getUsername();
     $details['firsName'] = $user->getFirstName();
     $details['lastName'] = $user->getLastName();
     $details['cursusId'] = $cursus->getId();
     $details['cursusTitle'] = $cursus->getTitle();
     $details['cursusCode'] = $cursus->getCode();
     parent::__construct(self::ACTION, $details, $user);
 }
Esempio n. 3
0
 private function unlockedChildrenHierarchy(Cursus $cursus, array $hierarchy, array &$lockedHierarchy, array &$unlockedCursus)
 {
     $cursusId = $cursus->getId();
     if (isset($hierarchy[$cursusId])) {
         foreach ($hierarchy[$cursusId] as $child) {
             if (!$child->isBlocking()) {
                 $lockedHierarchy[$child->getId()] = 'down';
                 $unlockedCursus[] = $child;
                 $this->unlockedChildrenHierarchy($child, $hierarchy, $lockedHierarchy, $unlockedCursus);
             }
         }
     }
 }