lib/DataSift/Push/Subscription.php
public static function listSubscriptions(
        $user,
        $page = 1,
        $per_page = 20,
        $order_by = self::ORDERBY_CREATED_AT,
        $order_dir = self::ORDERDIR_ASC,
        $include_finished = false,
        $hash_type = false,
        $hash = false
    ) {
        if ($page < 1) {
            throw new DataSift_Exception_InvalidData("The specified page number is invalid");
        }

        if ($per_page < 1) {
            throw new DataSift_Exception_InvalidData("The specified per_page value is invalid");
        }

        $params = array(
            'page' => $page,
            'per_page' => $per_page,
            'order_by' => $order_by,
            'order_dir' => $order_dir,
        );

        if ($hash_type !== false && $hash !== false) {
            $params[$hash_type] = $hash;
        }

        if ($include_finished) {
            $params['include_finished'] = '1';
        }

        $res = $user->post('push/get', $params);

        $retval = array('count' => $res['count'], 'subscriptions' => array());
        foreach ($res['subscriptions'] as $sub) {
            $retval['subscriptions'][] = new self($user, $sub);
        }

        return $retval;
    }
public static function listSubscriptions(
        $user,
        $page = 1,
        $per_page = 20,
        $order_by = self::ORDERBY_CREATED_AT,
        $order_dir = self::ORDERDIR_ASC,
        $include_finished = false,
        $hash_type = false,
        $hash = false
    ) {
        if ($page < 1) {
            throw new DataSift_Exception_InvalidData("The specified page number is invalid");
        }

        if ($per_page < 1) {
            throw new DataSift_Exception_InvalidData("The specified per_page value is invalid");
        }

        $params = array(
            'page' => $page,
            'per_page' => $per_page,
            'order_by' => $order_by,
            'order_dir' => $order_dir,
        );

        if ($hash_type !== false && $hash !== false) {
            $params[$hash_type] = $hash;
        }

        if ($include_finished) {
            $params['include_finished'] = '1';
        }

        $res = $user->post('push/get', $params);

        $retval = array('count' => $res['count'], 'subscriptions' => array());
        foreach ($res['subscriptions'] as $sub) {
            $retval['subscriptions'][] = new self($user, $sub);
        }

        return $retval;
    }
public static function listSubscriptions ( $ user , $ page = 1 , $ per_page = 20 , $ order_by = self :: ORDERBY_CREATED_AT , $ order_dir = self :: ORDERDIR_ASC , $ include_finished = false , $ hash_type = false , $ hash = false ) { if ( $ page < 1 ) { throw new DataSift_Exception_InvalidData ( "The specified page number is invalid" ) ; } if ( $ per_page < 1 ) { throw new DataSift_Exception_InvalidData ( "The specified per_page value is invalid" ) ; } $ params = array ( 'page' => $ page , 'per_page' => $ per_page , 'order_by' => $ order_by , 'order_dir' => $ order_dir , ) ; if ( $ hash_type !== false && $ hash !== false ) { $ params [ $ hash_type ] = $ hash ; } if ( $ include_finished ) { $ params [ 'include_finished' ] = '1' ; } $ res = $ user -> post ( 'push/get' , $ params ) ; $ retval = array ( 'count' => $ res [ 'count' ] , 'subscriptions' => array ( ) ) ; foreach ( $ res [ 'subscriptions' ] as $ sub ) { $ retval [ 'subscriptions' ] [ ] = new self ( $ user , $ sub ) ; } return $ retval ; }
Get a page of push subscriptions in the given user's account, where
each page contains up to per_page items. Results will be ordered
according to the supplied ordering parameters.

@param DataSift_User $user             The user.
@param int           $page             The page number to fetch.
@param int           $per_page         The number of items per page.
@param string        $order_by         The field on which to order the results.
@param string        $order_dir        The direction of the ordering.
@param boolean       $include_finished True to include subscriptions against
finished historic queries.
@param string        $hash_type        Stream hash or Historics playback id.
@param string        $hash             The stream hash or historics subscription id string.

@return array Of DataSift_Push_Subscription objects.
@throws DataSift_Exception_InvalidData
@throws DataSift_Exception_APIError
@throws DataSift_Exception_AccessDenied
Get a page of push subscriptions in the given user s account where each page contains up to per_page items . Results will be ordered according to the supplied ordering parameters .