/** * */ public function syncGrouphubGroupsFromQueue() { $this->logger->info('Processing Grouphub groups from queue...'); $groupIds = $this->queue->getQueuedGroups(); $grouphubGroups = $this->api->findGrouphubGroupsByIds($groupIds); $ldapGroups = $this->ldap->findGrouphubGroupsByIds($groupIds); if (count($grouphubGroups) === 0 && count($ldapGroups) === 0) { $this->logger->info('Done syncing Grouphub groups!'); return; } $this->doGrouphubGroupsSync($grouphubGroups, $ldapGroups); $this->queue->clearGroupQueue(); }
/** * @param int $groupId * @param int $userId */ public function addMembership($groupId, $userId) { $this->client->addGroupUser($groupId, $userId); $this->queue->addGroupToQueue($groupId); }
/** * @param Group $group */ public function updateGroup(Group $group) { $this->client->updateGroup($group->getId(), $group); $this->queue->addGroupToQueue($group->getId()); }