lib/DataSift/Push/Definition.php
protected function subscribe($hash_type, $hash, $name)
    {
        $retval = false;

        // API call parameters
        $params = array(
            'name' => $name,
            $hash_type => $hash,
            'output_type' => $this->_output_type,
        );
        // Prefix the output parameters
        foreach ($this->_output_params as $key => $val) {
            $params[self::OUTPUT_PARAMS_PREFIX . $key] = $val;
        }
        // Add the initial status if it's not empty
        if (strlen($this->getInitialStatus()) > 0) {
            $params['initial_status'] = getInitialStatus();
        }

        // Call the API and create a new PushSubscription from the returned
        // object
        return new DataSift_Push_Subscription($this->_user, $this->_user->post('push/create', $params));
    }
protected function subscribe($hash_type, $hash, $name)
    {
        $retval = false;

        // API call parameters
        $params = array(
            'name' => $name,
            $hash_type => $hash,
            'output_type' => $this->_output_type,
        );
        // Prefix the output parameters
        foreach ($this->_output_params as $key => $val) {
            $params[self::OUTPUT_PARAMS_PREFIX . $key] = $val;
        }
        // Add the initial status if it's not empty
        if (strlen($this->getInitialStatus()) > 0) {
            $params['initial_status'] = getInitialStatus();
        }

        // Call the API and create a new PushSubscription from the returned
        // object
        return new DataSift_Push_Subscription($this->_user, $this->_user->post('push/create', $params));
    }
protected function subscribe ( $ hash_type , $ hash , $ name ) { $ retval = false ; // API call parameters $ params = array ( 'name' => $ name , $ hash_type => $ hash , 'output_type' => $ this -> _output_type , ) ; // Prefix the output parameters foreach ( $ this -> _output_params as $ key => $ val ) { $ params [ self :: OUTPUT_PARAMS_PREFIX . $ key ] = $ val ; } // Add the initial status if it's not empty if ( strlen ( $ this -> getInitialStatus ( ) ) > 0 ) { $ params [ 'initial_status' ] = getInitialStatus ( ) ; } // Call the API and create a new PushSubscription from the returned // object return new DataSift_Push_Subscription ( $ this -> _user , $ this -> _user -> post ( 'push/create' , $ params ) ) ; }
Subscribe this endpoint to a stream hash or historic playback ID. Note
that this will activate the subscription if the initial status is set
to active.

@param string $hash_type "hash" or "playback_id"
@param string $hash      The hash or playback ID.
@param string $name      A name for this subscription.

@return DataSift_PushSubscription The new subscription.
@throws DataSift_Exception_InvalidData
@throws DataSift_Exception_APIError
@throws DataSift_Exception_AccessDenied
Subscribe this endpoint to a stream hash or historic playback ID . Note that this will activate the subscription if the initial status is set to active .