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 registerToCursusWorkspace(AbstractRoleSubject $ars, Cursus $cursus) { $workspace = $cursus->getWorkspace(); if (!is_null($workspace)) { $collaborator = $this->roleManager->getCollaboratorRole($workspace); $this->roleManager->associateRole($ars, $collaborator); } }