コード例 #1
0
ファイル: UMManager.php プロジェクト: DavidGarciaCat/eyeos
        $event = new UMEvent($principal, $oldPrincipal);
        if ($principal instanceof IUser) {
            $this->logger->info('User updated: ' . $principal);
            $this->fireEvent('userUpdated', $event);
        } else {
            if ($principal instanceof IWorkgroup) {
                $this->logger->info('Workgroup updated: ' . $principal);
                $this->fireEvent('workgroupUpdated', $event);
            } else {
                if ($principal instanceof IGroup) {
                    $this->logger->info('Group updated: ' . $principal);
                    $this->fireEvent('groupUpdated', $event);
                }
            }
        }
    }
    /**
     * Updates a new assignation user/workgroup.
     * 
     * @param IUserWorkgroupAssignation $assignation
     * @throws EyeInvalidArgumentException If some mandatory fields are missing in the given argument.
     */
    public function updateUserWorkgroupAssignation(IUserWorkgroupAssignation $assignation)
    {
        self::getPrincipalsManagerInstance()->updateUserWorkgroupAssignation($assignation);
        // userWorkgroupAssignationUpdated event is fired from the implementation class
        // (the old assignation is the relatedSource of the event object)
    }
}
UMManager::init();