PHP Class DataSift_Push_Definition

Author: Stuart Dallas ([email protected])
Show file Open project: datasift/datasift-php Class Usage Examples

Protected Properties

Property Type Description
$_initial_status An initial status for push subscriptions.
$_output_params The output parameters.
$_output_type The output_type of this push definition.
$_user The user that owns this push definition.

Public Methods

Method Description
__construct ( DataSift_User $user = false ) Constructor. Takes the user creating the object.
getInitialStatus ( ) : string Get the initial status for subscriptions.
getOutputParam ( string $key ) : string Get an output parameter.
getOutputParams ( ) : array Get all of the output parameters.
getOutputType ( ) : string Get the output type.
setInitialStatus ( string $status ) Set the initial status for subscriptions.
setOutputParam ( string $key, string $val ) Set an output parameter.
setOutputType ( string $type ) Set the output type.
subscribeDefinition ( DataSift_Definition $definition, string $name ) : DataSift_PushSubscription Subscribe this endpoint to a Definition.
subscribeHistoric ( DataSift_Historic $historic, string $name ) : DataSift_PushSubscription Subscribe this endpoint to a Historic.
subscribeHistoricPlaybackId ( string $playback_id, string $name ) : DataSift_PushSubscription Subscribe this endpoint to a historic playback ID.
subscribeStreamHash ( string $hash, string $name ) : DataSift_PushSubscription Subscribe this endpoint to a stream hash.
validate ( ) Validate the output type and parameters with the DataSift API.

Protected Methods

Method Description
subscribe ( string $hash_type, string $hash, string $name ) : DataSift_PushSubscription 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.

Method Details

__construct() public method

Constructor. Takes the user creating the object.
public __construct ( DataSift_User $user = false )
$user DataSift_User The user creating this object.

getInitialStatus() public method

Get the initial status for subscriptions.
public getInitialStatus ( ) : string
return string

getOutputParam() public method

Get an output parameter.
public getOutputParam ( string $key ) : string
$key string The parameter to get.
return string

getOutputParams() public method

Get all of the output parameters.
public getOutputParams ( ) : array
return array

getOutputType() public method

Get the output type.
public getOutputType ( ) : string
return string

setInitialStatus() public method

Set the initial status for subscriptions.
public setInitialStatus ( string $status )
$status string The initial status.

setOutputParam() public method

Set an output parameter.
public setOutputParam ( string $key, string $val )
$key string The output parameter to set.
$val string The value to set it to.

setOutputType() public method

Set the output type.
public setOutputType ( string $type )
$type string The output type.

subscribe() protected method

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.
protected subscribe ( string $hash_type, string $hash, string $name ) : DataSift_PushSubscription
$hash_type string "hash" or "playback_id"
$hash string The hash or playback ID.
$name string A name for this subscription.
return DataSift_PushSubscription The new subscription.

subscribeDefinition() public method

Subscribe this endpoint to a Definition.
public subscribeDefinition ( DataSift_Definition $definition, string $name ) : DataSift_PushSubscription
$definition DataSift_Definition The definition to which to subscribe.
$name string A name for this subscription.
return DataSift_PushSubscription The new subscription.

subscribeHistoric() public method

Subscribe this endpoint to a Historic.
public subscribeHistoric ( DataSift_Historic $historic, string $name ) : DataSift_PushSubscription
$historic DataSift_Historic The historic object to which to subscribe.
$name string A name for this subscription.
return DataSift_PushSubscription The new subscription.

subscribeHistoricPlaybackId() public method

Subscribe this endpoint to a historic playback ID.
public subscribeHistoricPlaybackId ( string $playback_id, string $name ) : DataSift_PushSubscription
$playback_id string The playback ID.
$name string A name for this subscription.
return DataSift_PushSubscription The new subscription.

subscribeStreamHash() public method

Subscribe this endpoint to a stream hash.
public subscribeStreamHash ( string $hash, string $name ) : DataSift_PushSubscription
$hash string The has to which to subscribe.
$name string A name for this subscription.
return DataSift_PushSubscription The new subscription.

validate() public method

Validate the output type and parameters with the DataSift API.
public validate ( )

Property Details

$_initial_status protected property

An initial status for push subscriptions.
protected $_initial_status

$_output_params protected property

The output parameters.
protected $_output_params

$_output_type protected property

The output_type of this push definition.
protected $_output_type

$_user protected property

The user that owns this push definition.
protected $_user