get the count of subscription in a subscriber ID
@param $subscriberID
@param $status
@return unknown_type
494793
static function countWithSubscriberID( $subscriberID, $languageID =false , $enabled = false )
    {
        $cond = array();
        $cond['subscriber_id'] = $subscriberID;
        if ( $enabled !== false )
        {
            $cond['enabled'] = $enabled;
        }
        if ( $languageID !== false )
        {
            $cond['language_id'] = $languageID;
        }
        $count = eZPersistentObject::count( self::definition(), $cond );
        return $count;
    }
387967
public function getFor(Customer $customer, $subscriptionId, array $parameters = [])
    {
        $this->parentId = $customer->id;

        return parent::rest_read($subscriptionId, $parameters);
    }
956718
public function setSubscribed($id, $subscribed)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/subscribed', array('value' => $subscribed));
    }
927366
public static function getSubscriptions(Network $network, $userId) {
		$url = self::getSubscriptionUrl($network, $network->getUrnForUser($userId));

		$response = Client::GET($url, self::getHeaders($network));

		$body = self::getDataFromResponse($response);
		if (!property_exists($body, "subscriptions")) {
			return null;
		}

		$subscriptions = array();
		foreach ($body->{"subscriptions"} as &$sub) {
			$subscriptions[] = Subscription::serializeFromJson($sub);
		}

		return $subscriptions;
	}
919605
public function getSubscriptionsCount()
    {
        $cache = Podium::getInstance()->podiumCache->getElement('user.subscriptions', $this->id);
        if ($cache === false) {
            $cache = (new Query)->from(Subscription::tableName())->where([
                    'user_id' => $this->id,
                    'post_seen' => Subscription::POST_NEW
                ])->count();
            Podium::getInstance()->podiumCache->setElement('user.subscriptions', $this->id, $cache);
        }
        return $cache;
    }
802171
public function countByOrderId($orderId, $statusIds = array(), $comparator = "=")
    {
        return $this->getShippingRepository()->countByOrderId($orderId, $statusIds, $comparator);
    }
1251818
def count_subscriptions(self, params={}):
        
        url = self.SUBSCRIPTIONS_COUNT_URL + '?'

        for key, value in params.items():
            if key is 'ids':
                value = ",".join(value)

            url += '&%s=%s' % (key, value)

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.get_request()
842961
public function setThreadSubscription(int $id, bool $subscribed = false, bool $ignored = false): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/notifications/threads/:id/subscription?:args', $id,
            http_build_query(['subscribed' => $subscribed, 'ignored' => $ignored])), Request::METHOD_PUT);
    }
492136
public function setOrderStatus($orderId, $status, $subStatus = null)
    {
        $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '/status.json';

        $data = [
            "order" => [
                "status" => $status
            ]
        ];
        if ($subStatus) {
            $data['order']['substatus'] = $subStatus;
        }

        $response = $this->sendRequest(
            'PUT',
            $this->getServiceUrl($resource),
            [
                'json' => $data
            ]
        );

        $decodedResponseBody = $this->getDecodedBody($response->getBody());

        $updateOrderStatusResponse = new UpdateOrderStatusResponse($decodedResponseBody);
        return $updateOrderStatusResponse->getOrder();
    }
420457
public function findByStatusIdAndUser($locale, $statusId, $user, $limit = null)
    {
        return $this->orderRepository->findByStatusIdAndUser(
            $locale,
            $statusId,
            $user,
            $limit
        );
    }
1358567
public function getForumActions($forum_id, $subscriptions, $is_subscribed)
    {
        $forum_actions = [];

        $forum_actions = Container::get('hooks')
            ->fire('model.forum.get_page_head_start', $forum_actions, $forum_id, $subscriptions, $is_subscribed);

        if (!User::get()->is_guest) {
            if ($subscriptions == 1) {
                if ($is_subscribed) {
                    $forum_actions[] = '<span>'.__('Is subscribed').
                        ' - </span><a class="btn btn-primary btn-sm" href="'.
                        Router::pathFor('unsubscribeForum', ['id' => $forum_id]).'">'.__('Unsubscribe').'</a>';
                } else {
                    $forum_actions[] = '<a class="btn btn-primary btn-sm" href="'.
                        Router::pathFor('subscribeForum', ['id' => $forum_id]).'">'.__('Subscribe').'</a>';
                }
            }

            $forum_actions[] = '<a class="btn btn-primary btn-sm" href="'.
                Router::pathFor('markForumRead', ['id' => $forum_id]).'">'.__('Mark forum read').'</a>';
        }

        $forum_actions = Container::get('hooks')->fire('model.forum.get_page_head', $forum_actions);

        return $forum_actions;
    }
774841
public Integer getSubscriptionsCount(final QueryParams params) {
        FluentCaseInsensitiveStringsMap map = doHEAD(Subscription.SUBSCRIPTION_RESOURCE,  params);
        return Integer.parseInt(map.getFirstValue(X_RECORDS_HEADER_NAME));
    }
1001265
public function getSubscribers($groupId, $type = null, $params = [])
    {
        $endpoint = $this->endpoint . '/' . $groupId . '/subscribers';

        if ($type !== null) {
            $endpoint .=  '/' . $type;
        }

        $params = array_merge($this->prepareParams(), $params);

        $response = $this->restClient->get($endpoint, $params);

        return $response['body'];
    }
1253489
def _subscribed_event_count(self) -> int:
        
        event_counter = Counter()  # type: Dict[Any, int]

        for key, values in self._events.items():
            event_counter[key] = len(values)

        return sum(event_counter.values())
915054
public function update($id, $subscriber)
    {
        if (!$id) {
            throw new \Exception('Subscriber id should be providen');
        }

        $this->assertValidSubscriberParams($subscriber);

        $request = new Request('subscribers');
        $request->setIdParam($id);
        $request->setParams($this->getSubscriberParams($subscriber));

        $response = $this->client->put($request);

        $this->assertSuccessResponse($response);

        return $response->getData();
    }
713018
function status($pubnub, $status)
    {

        if (!$this->_subscription->keepPolling()) {
            $sub = $this->_subscription->subscription();
            $e = new PubNubUnsubscribeException();
            $e->setChannels($sub['deliveryMode']['address']);
            throw $e;
        }

        $cat = $status->getCategory();

        if ($cat === PNStatusCategory::PNUnexpectedDisconnectCategory ||
            $cat === PNStatusCategory::PNTimeoutCategory
        ) {
            $this->_subscription->pubnubTimeoutHandler();
        }

    }
877341
public function countBySubQuery($conditions = false)
    {
        $this->andWhere($conditions);
        return (int)$this->db->fetchColumn($this->getSqlForCount(), $this->params);
    }