List subscriptions

Example URL: /subscriptions

@param  string[mixed] $params An associative array for any params
@return ListResponse
779422
protected function _doList($params = array())
    {
        $path = "/subscriptions";
        if(isset($params['params'])) { $params['query'] = $params['params'];
            unset($params['params']);
        }

        
        $response = $this->api_client->get($path, $params);
        

        return $this->getResourceForResponse($response);
    }
467648
public function getByParams($params)
	{
		try {
			//validate
			$obj    = new \erdiko\users\entities\User;
			$params = (array) $params;
			$filter = array();
			foreach ($params as $key => $value) {
				$method = "get" . ucfirst( $key );
				if (method_exists($obj, $method)) {
					$filter[ $key ] = $value;
				}
			}
			$repo   = $this->getRepository( 'erdiko\users\entities\User' );
			$result = empty($filter)
				? $this->getUsers()
				: $repo->findBy( $filter );
		} catch (\Exception $e) {
			throw new \Exception($e->getMessage());
		}
		return $result;
	}
66252
public function getList($params = array())
    {
        $resource = 'georegion.json';
        $resource .= '?' . $this->buildQueryString($params);
        $response = $this->getServiceResponse($resource);

        $geoRegions = new Models\ResponseGeoRegionsGet($response);

        return $geoRegions;
    }
471132
public function withPost(array $params)
    {
        $request = $this;
        if ($this->isJson()) {
            $body = json_encode($params);
        } else {
            $body = http_build_query($params);
            if (!$this->hasHeader('Content-Type')) {
                $request = $this->withHeader('Content-Type', 'application/x-www-form-urlencoded');
            }
        }

        return new self(
            $request->getMethod(),
            $request->getUri(),
            $request->getHeaders(),
            $body,
            $request->getProtocolVersion(),
            $request->getRetries(),
            $request->getOptions(),
            $this->getServiceKey(),
            $this->getRequestKey()
        );
    }
342405
public function QuerySubscriptions(Request\QuerySubscriptions $QuerySubscriptions = null)
    {
        $uri = $this->getUri('/subscription', array());

        return $this->get($uri, $QuerySubscriptions);
    }
660716
def list_subscriptions(self, service):
        """"""
        data = {
            'service': service,
        }
        return self._perform_post_request(self.list_subscriptions_endpoint, data, self.token_header)
195665
public static function listAllCouponsAsync(array $parameters = [])
    {
        return self::listAllCouponsAsyncWithHttpInfo($page, $size, $sort)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
877124
public static function listAllPaymentsAsync(array $parameters = [])
    {
        return self::listAllPaymentsAsyncWithHttpInfo($page, $size, $sort)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
1082628
public function search($params)
    {
        $subquery = (new Query())
                    ->select(['m2.replyto'])
                    ->from(['m1' => Message::tableName()])
                    ->leftJoin(['m2' => Message::tableName()], 'm1.replyto = m2.id')
                    ->where(['is not', 'm2.replyto', null]);
        $query = static::find()->where(['and',
            ['receiver_id' => User::loggedId()],
            ['!=', 'receiver_status', self::STATUS_DELETED],
            ['not in', 'message_id', $subquery]
        ]);
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $dataProvider->sort->attributes['senderName'] = [
            'asc' => [
                User::tableName() . '.username' => SORT_ASC,
                User::tableName() . '.id' => SORT_ASC
            ],
            'desc' => [
                User::tableName() . '.username' => SORT_DESC,
                User::tableName() . '.id' => SORT_DESC
            ],
            'default' => SORT_ASC
        ];
        $dataProvider->sort->defaultOrder = ['id' => SORT_DESC];
        $dataProvider->pagination->pageSize = Yii::$app->session->get('per-page', 20);

        if (!($this->load($params) && $this->validate())) {
            $dataProvider->query->joinWith(['message' => function ($q) {
                $q->joinWith(['sender']);
            }]);
            return $dataProvider;
        }

        $dataProvider->query->andFilterWhere(['like', 'topic', $this->topic]);

        if (preg_match('/^(forum|orum|rum|um|m)?#([0-9]+)$/', strtolower($this->senderName), $matches)) {
            $dataProvider->query->joinWith(['message' => function ($q) use ($matches) {
                $q->joinWith(['sender' => function ($q) use ($matches) {
                    $q->andFilterWhere(['and',
                        [User::tableName() . '.id' => $matches[2]],
                        ['or',
                            ['username' => ''],
                            ['username' => null]
                        ]
                    ]);
                }]);
            }]);
        } elseif (preg_match('/^([0-9]+)$/', $this->senderName, $matches)) {
            $dataProvider->query->joinWith(['message' => function ($q) use ($matches) {
                $q->joinWith(['sender' => function ($q) use ($matches) {
                    $q->andFilterWhere(['or',
                        ['like', 'username', $this->senderName],
                        ['and',
                            ['id' => $matches[1]],
                            ['or',
                                ['username' => ''],
                                ['username' => null]
                            ]
                        ],
                    ]);
                }]);
            }]);
        } else {
            $dataProvider->query->joinWith(['message' => function ($q) {
                $q->joinWith(['sender' => function ($q) {
                    $q->andFilterWhere(['like', User::tableName() . '.username', $this->senderName]);
                }]);
            }]);
        }
        return $dataProvider;
    }
644430
public function listSubscriptions(string $username = null): array
    {
        if (null !== $username) {
            return $this->getApi()->request($this->getApi()->sprintf('/users/:username/subscriptions',
                $this->getActivity()->getOwner(), $this->getActivity()->getRepo(), $username));
        }

        return $this->getApi()->request($this->getApi()
                                             ->sprintf('/user/subscriptions', $this->getActivity()->getOwner(),
                                                 $this->getActivity()->getRepo()));
    }
563727
public function getList($params = array(), ServiceManager $sm) 
	{
		$page = isset($params['page']) ? (int)$params['page'] : 1;
		unset($params['page']);
		
		$params['limit'] = isset($params['limit']) ? (int) $params['limit'] : 30;
		// The eventual presence of 'offset' key has priority over calculated 'page' value
		$params['offset'] = isset($params['offset']) ? (int) $params['offset'] : ($page * $params['limit'] - $params['limit']);
		
		$routeName = 'UserUser/page';
		$routeParams = array('page' => $page);
		
		$paginator = $this->getPaginator($params);
		
		$data = array();
		foreach($paginator as $user) {
			$data[] = $this->get($user, $sm);
		}
		
		unset($params['limit']);
		unset($params['offset']);
		$queryParams = $params;

		$mainService = $sm->get('neobazaar.service.main');
		return array(
			'data' => $data,
			'paginationData' => Json::decode($mainService->getView()->paginationControl(
				$paginator,
				'Sliding',
				array('pagination/paginatorjson', 'Document'),
				array(
					'route' => $routeName,
					'params' => $routeParams, 
					'query' => $queryParams
				)
			))
		);
	}
648698
public function getPaginator($params = array()) 
	{
		$page = isset($params['page']) ? (int)$params['page'] : 1;
		$email = isset($params['email']) ? $params['email'] : null;
		$limit = isset($params['limit']) ? (int) $params['limit'] : 10;
		$offset = isset($params['offset']) ? (int) $params['offset'] : 0;
		
		
		$qb = $this->_em->createQueryBuilder();
		$qb->select(array('a'));
		$qb->from($this->getEntityName(), 'a');
		$qb->addOrderBy('a.dateInsert', 'DESC');
		
		if(null !== $email) {
			$qb->andWhere($qb->expr()->eq('a.email', ':paramEmail'));
			$qb->setParameter('paramEmail', $email);
		}
		
		$query = $qb->getQuery();
		$query->setFirstResult($offset);
		$query->setMaxResults($limit);
// 		$paginator = new DoctrinePaginator($query, $fetchJoinCollection = true);
// 		$result = array();
// 		foreach($paginator as $p) {
// 			$result[] = $p->getUserId();
// 		}
// 		$result = $query->getResult();
// 		$paginatorAdapter =  new RazorPaginator(
// 			$result,
// 			count($paginator)
// 		);
		$paginatorAdapter = new DoctrinePaginatorAdapter(new DoctrinePaginator($query));
		$paginator = new Paginator($paginatorAdapter);
		$paginator->setCurrentPageNumber($page);
		$paginator->setDefaultItemCountPerPage($limit);
		
		return $paginator;
	}
943253
public function all(array $params = array())
    {
        $endpoint = '/admin/events.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(Event::class, $response['events']);
    }
1015629
public static function groupBy($params) {
        $column = $params['args'][0];
        $ormObject = !is_null($params['ormObject']) ? $params['ormObject'] : ORM::for_table($params['table']);
        
        return $ormObject->group_by($column);
    }
496625
function listSubscribers(req, res, next) {
  var listSubscribersParams = {
    _id: req.params.id
  };

  logger.debug("Middleware: listSubscribers: ", {params: listSubscribersParams});

  forms.getNotifications(_.extend(req.connectionOptions, listSubscribersParams), formsResultHandlers(constants.resultTypes.forms, req, next));
}
778420
public function getSubscriptions()
    {
        if (!$this->__subscriptions) {
            $subscriptions = array();

            //Get all the public methods
            //$reflection = new ReflectionClass($this);
            //foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method)
            foreach ($this->getMethods() as $method) {
                if (substr($method, 0, 2) == 'on') {
                    $subscriptions[] = $method;
                }
            }

            $this->__subscriptions = $subscriptions;
        }

        return $this->__subscriptions;
    }
1068433
public function getAllSubscriptions()
    {
        $limit = RequestInterface::MAX_LIST_LIMIT;
        $offset = 0;
        $subscriptions = [[]];

        while (true) {
            $subscriptionBatch = $this->getSubscriptionsResponse($offset);
            $subscriptions[] = $subscriptionBatch;
            $offset += $limit;
            if (\count($subscriptionBatch) < $limit) {
                break;
            }
        }

        return \array_merge(...$subscriptions);
    }