PHP Class DataSift_Pylon

This software is the intellectual property of MediaSift Ltd., and is covered by retained intellectual property rights, including copyright. Distribution of this software is strictly forbidden under the terms of this license. The DataSift_Pylon class represents a private source
Author: Paul Mozo ([email protected])
Show file Open project: datasift/datasift-php Class Usage Examples

Public Methods

Method Description
__construct ( Datasift_User $user, array $data = false ) : DataSift_Pylon Construct the Datasift_Pylon object
analyze ( array $parameters, string $filter = false, integer $start = false, integer $end = false, string $id = false ) : array Analyze the recording
compile ( string $csdl = false ) : array Compiles the CSDL of this object
create ( $hash = false, $name = false )
find ( string $id ) : DataSift_Pylon Class method to find a Subscription
findAll ( $page = 1, $per_page = 20, $order_by = self::ORDERBY_CREATED_AT, $order_dir = self::ORDERDIR_ASC ) : DataSift_Pylon Class method to find all Subscriptions
fromId ( Datasift_User $user, $id ) : DataSift_Pylon Load an existing pylon from hash
get ( Datasift_User $user, string $id = false ) : DataSift_Pylon Get an existing recordings.
getAll ( Datasift_User $user, $page = 1, $per_page = 20, $order_by = self::ORDERBY_CREATED_AT, $order_dir = self::ORDERDIR_ASC ) : array List recordings
getCsdl ( ) : string Gets the CSDL
getEnd ( ) : integer Gets the end time of this PYLON subscription
getHash ( ) : string Gets the Hash
getId ( ) : string Gets the ID
getIdentityId ( ) : string Gets the id of the Identity this PYLON subscription is owned by
getName ( ) : string Gets the name of this Subscription
getRemainingAccountCapacity ( ) : integer Gets the remaining PYLON account capacity
getRemainingIndexCapacity ( ) : integer Gets the remaining capacity for this PYLON subscription
getStart ( ) : integer Gets the start time of this PYLON subscription
getStatus ( ) : string Gets the status of this PYLON subscription
getVolume ( ) : integer Gets the current volume of this PYLON subscription
hasReachedCapacity ( ) : boolean Has this Subscription reached its capacity?
reload ( ) Updates the object with fresh results from get
restart ( string $id = false ) Restarts the pylon recording
sample ( string $filter = false, integer $start = false, integer $end = false, integer $count = false, string $id = false ) : array Returns a list of sample interactions (super-public)
setCsdl ( string $csdl ) Sets the CSDL
setName ( string $name ) Sets the Name
start ( string $hash = false, string $name = false ) Creates a new recording or restarts an existing one if an ID is present
stop ( string $id = false ) Stops the pylon recording
tags ( string $id = false ) : array Analyze the tags in the data set
update ( string $id = false, string $hash = false, string $name = false ) Updates a recording with a new hash and or name
validate ( Datasift_User $user, string $csdl ) : array Validate CSDL

Private Methods

Method Description
load ( array $data ) Loads an pylon object from the get data

Method Details

__construct() public method

Construct the Datasift_Pylon object
public __construct ( Datasift_User $user, array $data = false ) : DataSift_Pylon
$user Datasift_User The Datasift user object
$data array Data used to populate the attributes of this object
return DataSift_Pylon

analyze() public method

Analyze the recording
public analyze ( array $parameters, string $filter = false, integer $start = false, integer $end = false, string $id = false ) : array
$parameters array the parameter array to be used to analyze the data set
$filter string additional CSDL filter
$start integer the start time of the pylon
$end integer the end time of the pylon
$id string If id is provided it will be set
return array Response from the compile

compile() public method

Compiles the CSDL of this object
public compile ( string $csdl = false ) : array
$csdl string If a CSDL string is passed to compile it will set the CSDL for the object
return array Response from the compile

create() public method

public create ( $hash = false, $name = false )

find() public method

Class method to find a Subscription
public find ( string $id ) : DataSift_Pylon
$id string
return DataSift_Pylon

findAll() public method

Class method to find all Subscriptions
public findAll ( $page = 1, $per_page = 20, $order_by = self::ORDERBY_CREATED_AT, $order_dir = self::ORDERDIR_ASC ) : DataSift_Pylon
return DataSift_Pylon

fromId() public static method

Previously called fromHash
public static fromId ( Datasift_User $user, $id ) : DataSift_Pylon
$user Datasift_User The Datasift user object
return DataSift_Pylon

get() public static method

Get an existing recordings.
public static get ( Datasift_User $user, string $id = false ) : DataSift_Pylon
$user Datasift_User The Datasift user object
$id string The id of the existing pylon
return DataSift_Pylon

getAll() public static method

List recordings
public static getAll ( Datasift_User $user, $page = 1, $per_page = 20, $order_by = self::ORDERBY_CREATED_AT, $order_dir = self::ORDERDIR_ASC ) : array
$user Datasift_User The Datasift user object
return array

getCsdl() public method

Gets the CSDL
public getCsdl ( ) : string
return string The CSDL assigned to the object

getEnd() public method

Gets the end time of this PYLON subscription
public getEnd ( ) : integer
return integer

getHash() public method

Gets the Hash
public getHash ( ) : string
return string $hash The hash of the pylon recording

getId() public method

Gets the ID
public getId ( ) : string
return string $id The ID of the pylon

getIdentityId() public method

Gets the id of the Identity this PYLON subscription is owned by
public getIdentityId ( ) : string
return string

getName() public method

Gets the name of this Subscription
public getName ( ) : string
return string

getRemainingAccountCapacity() public method

Gets the remaining PYLON account capacity

getRemainingIndexCapacity() public method

Gets the remaining capacity for this PYLON subscription

getStart() public method

Gets the start time of this PYLON subscription
public getStart ( ) : integer
return integer

getStatus() public method

Gets the status of this PYLON subscription
public getStatus ( ) : string
return string

getVolume() public method

Gets the current volume of this PYLON subscription
public getVolume ( ) : integer
return integer

hasReachedCapacity() public method

Has this Subscription reached its capacity?
public hasReachedCapacity ( ) : boolean
return boolean

reload() public method

Updates the object with fresh results from get
public reload ( )

restart() public method

Restarts the pylon recording
public restart ( string $id = false )
$id string If ID is provided it will be set

sample() public method

Returns a list of sample interactions (super-public)
public sample ( string $filter = false, integer $start = false, integer $end = false, integer $count = false, string $id = false ) : array
$filter string additional CSDL filter
$start integer the start time of the pylon
$end integer the end time of the pylon
$count integer optional value to set the count
$id string The id of the existing pylon
return array Response from the sample endpoint

setCsdl() public method

Sets the CSDL
public setCsdl ( string $csdl )
$csdl string the csdl string.

setName() public method

Sets the Name
public setName ( string $name )
$name string The name of the pylon

start() public method

Creates a new recording or restarts an existing one if an ID is present
public start ( string $hash = false, string $name = false )
$hash string If hash is provided it will be set
$name string If name is provided it will be set

stop() public method

Stops the pylon recording
public stop ( string $id = false )
$id string If ID is provided it will be set

tags() public method

Analyze the tags in the data set
public tags ( string $id = false ) : array
$id string If ID is provided it will be set
return array Response from the tags endpoint

update() public method

Updates a recording with a new hash and or name
public update ( string $id = false, string $hash = false, string $name = false )
$id string The id of the existing recording
$hash string The new hash of the pylon recording
$name string The new updated name of the recording

validate() public static method

Validate CSDL
public static validate ( Datasift_User $user, string $csdl ) : array
$user Datasift_User The Datasift user object
$csdl string The CSDL to validate
return array The response from validating the CSDL