@param $orgId

@return OrganizationUsersList|\Protobuf\Message
498426
public function getOrganizationUsers($orgId)
    {
        $response = $this->doRequest(
            self::RESOURCE_GET_ORGANIZATION_USERS,
            [
                'orgId' => $orgId
            ]
        );

        return OrganizationUsersList::fromStream($response);
    }
355326
public function list(string $userId, array $options = []): \Google_Service_Gmail_ListMessagesResponse
    {
        return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_messages->listUsersMessages($userId, $options);
    }
1089893
public function index($memberId)
    {
        $member = Member::findOrFail($memberId);
        $this->authorize('view', $member);
        return $this->respondRelatedPhones($member->user_id, 'member');
    }
1165562
public function byOrganizationAndByKey($organizationId, $key)
  {
    if(empty($databaseConnectionName))
    {
      $databaseConnectionName = $this->databaseConnectionName;
    }

    return $this->Account->setConnection($databaseConnectionName)
      ->where('organization_id', '=', $organizationId)
      ->where('key', '=', $key)->get();
  }
854462
public function listOrganizationMenus($organizationId, $slug = null)
    {
        list($response) = $this->listOrganizationMenusWithHttpInfo($organizationId, $slug);
        return $response;
    }
87079
public function createMembership($userId, $roles = [Membership::ROLE_READ], $organization = '')
    {
        if (\is_string($roles)) {
            $roles = [$roles];
        }
        $roles = array_map(function ($role) {
            return strtolower($role);
        }, $roles);
        $contents = $this
            ->call('PUT', implode('/', [self::ORGANIZATION_RESOURCE, $this->getOrganizationName($organization), 'memberships', $userId]), ['json' => [
                'roles' => $roles,
            ]])
            ->getBody()
            ->getContents();

        // get the membership, if it already exists
        if (empty($contents)) {
            return $this->getMembership($userId, $this->getOrganizationName($organization));
        }

        return $this->getSingleMemberShipFromJsonResponse($contents);
    }
736818
public function getRelist($itemId)
    {
        $item = Item::findOrFail($itemId);

        Session::forget('photos');

        foreach ($item->photos as $photo) {
            Session::push('photos', [
                'real_path' => $photo->getPath(),
                'filename'  => $photo->photoId,
            ]);
        }

        $categories = Category::leaves()->orderBy('category_id')->get();

        return view('mustard::item.new', [
            'item'       => $item,
            'categories' => $categories,
        ]);
    }
200617
public function getAllWebhooks($roomId)
    {
        $webhooks = array();
        $response = $this->client->get(sprintf('/v2/room/%s/webhook', $roomId));
        foreach ($response['items'] as $item) {
            $webhooks[] = new Webhook($item);
        }

        return $webhooks;
    }
1295760
public function getPermissionTable($userId)
    {
        if ($this->_permissionTable === null) {
            $this->_permissionTable = (new Query())
                ->select(['*'])
                ->from('{{%admin_user_group}}')
                ->innerJoin('{{%admin_group_auth}}', '{{%admin_user_group}}.group_id={{%admin_group_auth}}.group_id')
                ->innerJoin('{{%admin_auth}}', '{{%admin_group_auth}}.auth_id = {{%admin_auth}}.id')
                ->where(['{{%admin_user_group}}.user_id' => $userId])
                ->all();
        }
        
        return $this->_permissionTable;
    }
804239
public function getModuleItems($nodeId)
    {
        if (isset($this->_nodeItems[$nodeId])) {
            return $this->_nodeItems[$nodeId];
        }
        
        $data = $this->getNodeData($nodeId);
        
        if (isset($data['groups'])) {
            foreach ($data['groups'] as $groupName => $groupItem) {
                // translate the group names
                try {
                    $data['groups'][$groupName]['name'] = Yii::t($data['moduleId'], $groupItem['name'], [], Yii::$app->language);
                } catch (\Exception $e) {
                    // do nothing and keep the current name inside the array
                }
                foreach ($groupItem['items'] as $groupItemKey => $groupItemEntry) {
                    if ($groupItemEntry['permissionIsRoute']) {
                        if (!Yii::$app->auth->matchRoute($this->getUserId(), $groupItemEntry['route'])) {
                            unset($data['groups'][$groupName]['items'][$groupItemKey]);
                            continue;
                        }
                    } elseif ($groupItemEntry['permissionIsApi']) {
                        if (!Yii::$app->auth->matchApi($this->getUserId(), $groupItemEntry['permissionApiEndpoint'])) {
                            unset($data['groups'][$groupName]['items'][$groupItemKey]);
                            continue;
                        }
                    } else {
                        throw new Exception('Menu item detected without permission entry');
                    }
                    try {
                        $alias = Yii::t($data['moduleId'], $data['groups'][$groupName]['items'][$groupItemKey]['alias'], [], Yii::$app->language);
                    } catch (\Exception $err) {
                        $alias = $data['groups'][$groupName]['items'][$groupItemKey]['alias'];
                    }
                    
                    // if a pool is available, the route will be modified by appending the pool param
                    $pool = AdminMenuBuilder::getOptionValue($groupItemEntry, 'pool', null);
                    if ($pool) {
                        $data['groups'][$groupName]['items'][$groupItemKey]['route'] = $data['groups'][$groupName]['items'][$groupItemKey]['route'] . '?pool='.$pool;
                    }

                    $data['groups'][$groupName]['items'][$groupItemKey]['hiddenInMenu'] = AdminMenuBuilder::getOptionValue($groupItemEntry, 'hiddenInMenu', false);
                    $data['groups'][$groupName]['items'][$groupItemKey]['pool'] = AdminMenuBuilder::getOptionValue($groupItemEntry, 'pool', null);
                    $data['groups'][$groupName]['items'][$groupItemKey]['alias'] = $alias;
                }
                
                // if there are no items for this group, unset the group from the data array
                if (count($data['groups'][$groupName]['items']) == 0) {
                    unset($data['groups'][$groupName]);
                }
            }
            
            // if there are no groups reset the array to an empty array
            if (empty($data['groups'])) {
                $data = [];
            }
        } else {
            // as we want to catch all groups and the items of the groups, if the group has no items reset the array to an empty arrray
            $data = [];
        }

        $this->_nodeItems[$nodeId] = $data;

        return $data;
    }
1188518
public function getMessage($id)
    {
        // TODO that's ugly, would be better to let the message class decide
        if (strtolower($this->_messageClass) == 'zend_mail_message_file' || is_subclass_of($this->_messageClass, 'zend_mail_message_file')) {
            // TODO top/body lines
            $messagePos = $this->_getPos($id);
            return new $this->_messageClass(array('file' => $this->_fh, 'startPos' => $messagePos['start'],
                                                  'endPos' => $messagePos['end']));
        }

        $bodyLines = 0; // TODO: need a way to change that

        $message = $this->getRawHeader($id);
        // file pointer is after headers now
        if ($bodyLines) {
            $message .= "\n";
            while ($bodyLines-- && ftell($this->_fh) < $this->_positions[$id - 1]['end']) {
                $message .= fgets($this->_fh);
            }
        }

        return new $this->_messageClass(array('handler' => $this, 'id' => $id, 'headers' => $message));
    }
1071297
public function getGroup(string $groupid)
    {
        $cl = $this->getGroupClass();
        $group = new $cl;
        return $group->obtainByGroupID($groupid);
    }
254998
public function getSurveysFor($organizationId)
    {
        if ($organizationId !== null) {
            $where = "AND EXISTS (SELECT 1 FROM gems__rounds
                INNER JOIN gems__tracks ON gro_id_track = gtr_id_track
                WHERE gro_id_survey = gsu_id_survey AND
                gtr_organizations LIKE '%|" . (int) $organizationId . "|%')";
        } else {
            $where = "";
        }

        $sql = "SELECT gsu_id_survey, gsu_survey_name FROM gems__surveys WHERE gsu_active = 1 " .
            $where . " ORDER BY gsu_survey_name ASC";

        return $this->_getSelectPairsCached(__FUNCTION__. '_' . $organizationId, $sql, array(), 'surveys');
    }
43807
public function byOrganizationAndByKey($organizationId, $key)
  {
    return $this->CostCenter->where('organization_id', '=', $organizationId)->where('key', '=', $key)->get();
  }
315990
public function get_group($groupid) {
        $groups = $this->get_all_groups();
        if (!array_key_exists($groupid, $groups)) {
            return false;
        }
        return $groups[$groupid];
    }
1142611
public function listOrganizationMenuItems($organizationId, $menuId)
    {
        list($response) = $this->listOrganizationMenuItemsWithHttpInfo($organizationId, $menuId);
        return $response;
    }
485287
public function deleteAction($groupId)
    {
        $groupManager = $this->get('phlexible_user.group_manager');

        $group = $groupManager->find($groupId);
        $name = $group->getName();

        $groupManager->deleteGroup($group);

        $this->get('phlexible_message.message_poster')
            ->post(UsersMessage::create('Group "'.$group->getName().'" deleted.'));

        return new ResultResponse(true, "Group $name deleted.");
    }