Property | Type | Description | |
---|---|---|---|
$_created_at | The hash creation time as a UNIX timestamp. | ||
$_csdl | The CSDL source code. | ||
$_hash | The stream hash. | ||
$_total_dpu | The total number of DPUs used. | ||
$_user | The DataSift User object. |
Method | Description | |
---|---|---|
__construct ( DataSift_User $user, string $csdl = '', string $hash = false ) | Constructor. A DataSift_User object is required, and you can optionally supply a default definition string. | |
compile ( ) : void | Call the DataSift API to compile this defintion. On success it will store the returned hash. | |
createHistoric ( integer $start, integer $end, array $sources, string $name, float $sample = DataSift_Historic::DEFAULT_SAMPLE ) : DataSift_Historic | Create a historic based on this CSDL. | |
get ( ) : string | Returns the definition string. | |
getBuffered ( integer $count = false, integer $from_id = false ) : array | Call the DataSift API to get buffered interactions. | |
getConsumer ( string $type, DataSift_IStreamConsumerEventHandler $eventHandler ) : DataSift_StreamConsumer | Returns a DataSift_StreamConsumer-derived object for this definition, for the given type. | |
getCreatedAt ( ) : integer | Returns the date when the stream was first created. If the created at date has not yet been obtained it validates the definition first. | |
getDPUBreakdown ( ) : array | Call the DataSift API to get the DPU for this definition. Returns an array containing. | |
getHash ( ) : string | Returns the hash for this definition. If the hash has not yet been obtained it compiles the definition first. | |
getTotalDPU ( ) : integer | Returns the total DPU of the stream. If the DPU has not yet been obtained it validates the definition first. | |
set ( string $csdl ) : void | Sets the definition string. | |
validate ( ) : void | Call the DataSift API to validate this defintion. On success it will store the returned hash. |
Method | Description | |
---|---|---|
clearHash ( ) : void | Reset the hash to false. The effect of this is to mark the definition as requiring compilation. Also resets other variables that depend on the CSDL. |
public __construct ( DataSift_User $user, string $csdl = '', string $hash = false ) | ||
$user | DataSift_User | The user object. |
$csdl | string | An optional default definition string. |
$hash | string | An optional hash for the passed definition. |
public createHistoric ( integer $start, integer $end, array $sources, string $name, float $sample = DataSift_Historic::DEFAULT_SAMPLE ) : DataSift_Historic | ||
$start | integer | The timestamp from which to start the query. |
$end | integer | The timestamp at which to end the query. |
$sources | array | An array of sources required. |
$name | string | An optional name for this historic. |
$sample | float | Sample size (10 or 100) |
return | DataSift_Historic |
public getConsumer ( string $type, DataSift_IStreamConsumerEventHandler $eventHandler ) : DataSift_StreamConsumer | ||
$type | string | The consumer type for which to construct a consumer. |
$eventHandler | DataSift_IStreamConsumerEventHandler | An instance of DataSift_IStreamConsumerEventHandler |
return | DataSift_StreamConsumer | The consumer object. |
public getCreatedAt ( ) : integer | ||
return | integer | The date as a unix timestamp. |
public getDPUBreakdown ( ) : array | ||
return | array |
public getTotalDPU ( ) : integer | ||
return | integer | The total DPU. |
protected $_created_at |