PHP Class Segment_Consumer

ファイルを表示 Open project: segmentio/analytics-php Class Usage Examples

Protected Properties

Property Type Description
$options
$secret
$type

Public Methods

Method Description
__construct ( string $secret, array $options = [] ) Store our secret and options as part of this consumer
alias ( array $message ) : boolean Aliases from one user id to another
group ( array $message ) : boolean Tags traits about the group.
identify ( array $message ) : boolean Tags traits about the user.
page ( array $message ) : boolean Tracks a page view.
screen ( array $message ) : boolean Tracks a screen view.
track ( array $message ) : boolean Tracks a user action

Protected Methods

Method Description
debug ( ) : boolean Check whether debug mode is enabled
handleError ( string $code, string $msg ) On an error, try and call the error handler, if debugging output to error_log as well.
ssl ( ) : boolean Check whether we should connect to the API using SSL. This is enabled by default with connections which make batching requests. For connections which can save on round-trip times, you may disable it.

Method Details

__construct() public method

Store our secret and options as part of this consumer
public __construct ( string $secret, array $options = [] )
$secret string
$options array

alias() abstract public method

Aliases from one user id to another
abstract public alias ( array $message ) : boolean
$message array
return boolean whether the alias call succeeded

debug() protected method

Check whether debug mode is enabled
protected debug ( ) : boolean
return boolean

group() abstract public method

Tags traits about the group.
abstract public group ( array $message ) : boolean
$message array
return boolean whether the group call succeeded

handleError() protected method

On an error, try and call the error handler, if debugging output to error_log as well.
protected handleError ( string $code, string $msg )
$code string
$msg string

identify() abstract public method

Tags traits about the user.
abstract public identify ( array $message ) : boolean
$message array
return boolean whether the identify call succeeded

page() abstract public method

Tracks a page view.
abstract public page ( array $message ) : boolean
$message array
return boolean whether the page call succeeded

screen() abstract public method

Tracks a screen view.
abstract public screen ( array $message ) : boolean
$message array
return boolean whether the group call succeeded

ssl() protected method

Check whether we should connect to the API using SSL. This is enabled by default with connections which make batching requests. For connections which can save on round-trip times, you may disable it.
protected ssl ( ) : boolean
return boolean

track() abstract public method

Tracks a user action
abstract public track ( array $message ) : boolean
$message array
return boolean whether the track call succeeded

Property Details

$options protected_oe property

protected $options

$secret protected_oe property

protected $secret

$type protected_oe property

protected $type