Property | Type | Description | |
---|---|---|---|
$_created_at | The timestamp when this subscription was created. | ||
$_deleted | True if this subscription has been deleted (becomes read-only). | ||
$_hash | The hash to which this subscription is subscribed. | ||
$_hash_type | "stream" or "historic" | ||
$_id | The subscription ID. | ||
$_last_request | The timestamp of the last push request. | ||
$_last_success | The timestamp of the last successful push request. | ||
$_name | The name of this subscription. | ||
$_status | The current status of this subscription. |
Method | Description | |
---|---|---|
__construct ( DataSift_User $user, array $data ) | Construct a DataSift_Push_Subscription object from an array. | |
delete ( ) | Delete this subscription. | |
get ( DataSift_User $user, string $id ) : DataSift_Push_Subscription | Get a push subscription by ID. | |
getCreatedAt ( ) : integer | Get the timestamp when this subscription was created. | |
getHash ( ) : string | Get the hash or playback ID to which this subscription is subscribed. | |
getHashType ( ) : string | Get the hash type to which this subscription is subscribed. | |
getId ( ) : string | Get the subscription ID. | |
getLastRequest ( ) : integer | Get the timestamp of the last push request. | |
getLastSuccess ( ) : integer | Get the timestamp of the last successful push request. | |
getLog ( integer $page = 1, integer $per_page = 20, string $order_by = self::ORDERBY_REQUEST_TIME, string $order_dir = self::ORDERDIR_DESC ) : array | Get a page of the log for this subscription order as specified. | |
getLogs ( DataSift_User $user, integer $page = 1, integer $per_page = 20, string $order_by = self::ORDERBY_REQUEST_TIME, string $order_dir = self::ORDERDIR_ASC, string $id = false ) : array | Page through recent push subscription log entries, specifying the sort order. | |
getName ( ) : string | Get the subscription name. | |
getOutputType ( ) : string | Get the output type. | |
getStatus ( ) : string | Get the current status of this subscription. Make sure you call reload to get the latest data for this subscription first. | |
isDeleted ( ) : boolean | Returns true if this subscription has been deleted. | |
listByPlaybackId ( DataSift_User $user, string $playback_id, integer $page = 1, integer $per_page = 20, string $order_by = self::ORDERBY_CREATED_AT, string $order_dir = self::ORDERDIR_ASC, boolean $include_finished = false, string $hash_type = false, string $hash = false ) : array | Get a page of push subscriptions to the given stream playback_id, where each page contains up to per_page items. Results will be ordered according to the supplied ordering parameters. | |
listByStreamHash ( DataSift_User $user, string $hash, integer $page = 1, integer $per_page = 20, string $order_by = self::ORDERBY_CREATED_AT, string $order_dir = self::ORDERDIR_ASC, boolean $include_finished = false, string $hash_type = false ) : array | Get a page of push subscriptions to the given stream hash, where each page contains up to per_page items. Results will be ordered according to the supplied ordering parameters. | |
listSubscriptions ( DataSift_User $user, integer $page = 1, integer $per_page = 20, string $order_by = self::ORDERBY_CREATED_AT, string $order_dir = self::ORDERDIR_ASC, boolean $include_finished = false, string $hash_type = false, string $hash = false ) : array | 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. | |
pause ( ) | Pause this subscription. | |
pull ( integer $size = 20971520, string $cursor = false ) : array | Pull data from this subscription. | |
reload ( ) | Re-fetch this subscription from the API. | |
resume ( ) | Resume this subscription. | |
save ( ) | Save changes to the name and output_parameters of this subscription. | |
setOutputParam ( string $key, string $val ) | Set an output parameter. Checks to see if the subscription has been deleted, and if not calls the base class to set the parameter. | |
stop ( ) | Stop this subscription. |
Method | Description | |
---|---|---|
init ( array $data ) | Extract data from an array. | |
parseOutputParams ( array $params, string $prefix = '' ) : array | Recursive method to parse the output_params as received from the API into the flattened, dot-notation used by the client libraries. |
public __construct ( DataSift_User $user, array $data ) | ||
$user | DataSift_User | The user that owns this subscription. |
$data | array | The JSON object containing the subscription details. |
public getCreatedAt ( ) : integer | ||
return | integer |
public getHashType ( ) : string | ||
return | string |
public getLastRequest ( ) : integer | ||
return | integer |
public getLastSuccess ( ) : integer | ||
return | integer |
public getLog ( integer $page = 1, integer $per_page = 20, string $order_by = self::ORDERBY_REQUEST_TIME, string $order_dir = self::ORDERDIR_DESC ) : array | ||
$page | integer | The page to get. |
$per_page | integer | The number of entries per page. |
$order_by | string | By which field to order the entries. |
$order_dir | string | The direction of the sorting ("asc" or "desc"). |
return | array |
public static getLogs ( DataSift_User $user, integer $page = 1, integer $per_page = 20, string $order_by = self::ORDERBY_REQUEST_TIME, string $order_dir = self::ORDERDIR_ASC, string $id = false ) : array | ||
$user | DataSift_User | The user making the request. |
$page | integer | Which page to fetch. |
$per_page | integer | Based on this page size. |
$order_by | string | Which field to sort by. |
$order_dir | string | In asc[ending] or desc[ending] order. |
$id | string | Push subscription ID. |
return | array | Of LogEntry objects. |
public static listByPlaybackId ( DataSift_User $user, string $playback_id, integer $page = 1, integer $per_page = 20, string $order_by = self::ORDERBY_CREATED_AT, string $order_dir = self::ORDERDIR_ASC, boolean $include_finished = false, string $hash_type = false, string $hash = false ) : array | ||
$user | DataSift_User | The user. |
$playback_id | string | The Historics playback ID. |
$page | integer | The page number to fetch. |
$per_page | integer | The number of items per page. |
$order_by | string | The field on which to order the results. |
$order_dir | string | The direction of the ordering. |
$include_finished | boolean | True to include subscriptions against |
$hash_type | string | Stream hash or Historics playback id. |
$hash | string | The stream hash. finished historic queries. |
return | array | Of DataSift_Push_Subscription objects. |
public static listByStreamHash ( DataSift_User $user, string $hash, integer $page = 1, integer $per_page = 20, string $order_by = self::ORDERBY_CREATED_AT, string $order_dir = self::ORDERDIR_ASC, boolean $include_finished = false, string $hash_type = false ) : array | ||
$user | DataSift_User | The user. |
$hash | string | The stream hash. |
$page | integer | The page number to fetch. |
$per_page | integer | The number of items per page. |
$order_by | string | The field on which to order the results. |
$order_dir | string | The direction of the ordering. |
$include_finished | boolean | True to include subscriptions against |
$hash_type | string | Stream hash or Historics playback id. finished historic queries. |
return | array | Of DataSift_Push_Subscription objects. |
public static listSubscriptions ( DataSift_User $user, integer $page = 1, integer $per_page = 20, string $order_by = self::ORDERBY_CREATED_AT, string $order_dir = self::ORDERDIR_ASC, boolean $include_finished = false, string $hash_type = false, string $hash = false ) : array | ||
$user | DataSift_User | The user. |
$page | integer | The page number to fetch. |
$per_page | integer | The number of items per page. |
$order_by | string | The field on which to order the results. |
$order_dir | string | The direction of the ordering. |
$include_finished | boolean | True to include subscriptions against finished historic queries. |
$hash_type | string | Stream hash or Historics playback id. |
$hash | string | The stream hash or historics subscription id string. |
return | array | Of DataSift_Push_Subscription objects. |
public pull ( integer $size = 20971520, string $cursor = false ) : array | ||
$size | integer | The maximum amount of data that DataSift will send in a single batch. Can be any value from 1 byte through 20971520 bytes. |
$cursor | string | A pointer into the Push queue associated with the current Push subscription. |
return | array |
public save ( ) |
public setOutputParam ( string $key, string $val ) | ||
$key | string | The output parameter to set. |
$val | string | The value to which to set it. |
protected $_created_at |
protected $_deleted |
protected $_last_success |