Overview

Namespaces

  • Apptus
    • ESales
      • Connector
        • Report
        • Time
    • Util
      • Cache
  • PHP

Classes

  • Ad
  • Ads
  • ArgMap
  • Attribute
  • AttributeValidation
  • Authorization
  • Category
  • CategoryData
  • CategoryList
  • CategoryNode
  • CloudConnector
  • ClusterUriIterator
  • Completion
  • Completions
  • CompressionMode
  • Connector
  • ConnectorSettingsBuilder
  • Correction
  • Corrections
  • Count
  • CssClass
  • CustomerKeyAuthentication
  • DynamicPage
  • EventDataJobResult
  • FacetList
  • FacetRange
  • Facets
  • Filter
  • FilterBuilder
  • ImportData
  • JavaScriptNotifier
  • MessageAuthentication
  • OnPremConnector
  • Order
  • OrderLine
  • Panel
  • PanelContent
  • Path
  • Phrase
  • Phrases
  • Product
  • Products
  • Reporter
  • ResultType
  • Session
  • Status
  • Subpanel
  • Value
  • Values
  • Variant

Interfaces

  • Facet
  • Result

Exceptions

  • BusyClusterException
  • ClusterUnavailableException
  • DuplicateSubpanelException
  • FetchClusterException
  • IOException
  • MalformedJsonException
  • MalformedURLException
  • MissingSubpanelException
  • PanelException
  • ParseException
  • ReportException
  • RequestFailedException
  • ResultTypeException
  • Overview
  • Namespace
  • Class
  • Tree

Class Session

A session where information is exchanged with an eSales service.

Use the notification methods to notify the eSales service about client-side activities. These notification will be used to improve results from eSales with the use of machine learning algorithms, and for statistical reports.
A tutorial section describing the procedure for notifying client-side activities can be found in the tutorial section Notifying Customer Actions on Apptus Zone (http://zone.apptus.com).

Use the Session::panel() method to get a Apptus\ESales\Connector\Panel object, from which you may retrieve content from the eSales service.

You may (but need not) call the Session::end() method once the session is over. This will allow the eSales service to include the information in statistical reports.

The session will end automatically when neither a panel has been retrieved, nor a notifications has been sent, within 15 minutes.

Namespace: Apptus\ESales\Connector
Located at Connector/Session.php
Methods summary
public
# setTimestamp( long $timestamp )

Parameters

$timestamp
Custom timestamp, only used for system tests
public Apptus\ESales\Connector\Panel
# panel( string $path )

Returns a panel specified by the path supplied as argument.

Returns a panel specified by the path supplied as argument.

Parameters

$path
path of the panel

Returns

Apptus\ESales\Connector\Panel
A panel object with the specified path.
public Apptus\ESales\Connector\DynamicPage
# dynamicPage( name $name )

Creates a dynamic page with the specified name.

Creates a dynamic page with the specified name.

Parameters

$name
name of the panel

Returns

Apptus\ESales\Connector\DynamicPage
A dynamic page object with the specified name
public
# notifyProperty( string $name, string $value )

Sends a notification to the eSales service, about a session property being set.

Sends a notification to the eSales service, about a session property being set.

Later calls will overwrite the previous values of the property.

Parameters

$name
name of the property. Any valid Java identifier may be used.
$value
value of the property.

Throws

Apptus\ESales\Connector\RequestFailedException
if the notification cannot be sent to the eSales service.
InvalidArgumentException
if name or value is null or empty
public
# notifyClick( string $ticket )

Sends a notification to the eSales service, about a click being made by the user in a session.

Sends a notification to the eSales service, about a click being made by the user in a session.

Parameters

$ticket
ticked for the object that was clicked.

Throws

Apptus\ESales\Connector\RequestFailedException
if the notification cannot be sent to the eSales service.
InvalidArgumentException
if ticket is null or empty
public
# notifyAddingToCart( string $ticket )

Sends a notification to the eSales service, about a product being added to the shopping cart by a user in the session.

Sends a notification to the eSales service, about a product being added to the shopping cart by a user in the session.

Parameters

$ticket
ticked for the object that was added to the cart.

Throws

Apptus\ESales\Connector\RequestFailedException
if the notification cannot be sent to the eSales service.
InvalidArgumentException
if ticket is null or empty
public
# notifyNonEsalesClick( string $productKey, string $variantKey )

Sends a notification to the eSales service, about a non-eSales product click being made by the user in a session. This method should only be used on non-eSales rendered products where no ticket is available.

Sends a notification to the eSales service, about a non-eSales product click being made by the user in a session. This method should only be used on non-eSales rendered products where no ticket is available.

Parameters

$productKey
product key of the clicked product or may be null if you have a variant key.
$variantKey
variant key of the clicked variant or null if it is a click on a product only.

Throws

Apptus\ESales\Connector\RequestFailedException
If the notification cannot be sent to the eSales service.
InvalidArgumentException
If productKey or variantKey are empty or both are null.
public
# notifyNonEsalesAddingToCart( string $productKey, string $variantKey )

Sends a notification to the eSales service, about a non-eSales product being added to the shopping cart by a user in the session. This method should only be used on non-eSales rendered products where no ticket is available.

Sends a notification to the eSales service, about a non-eSales product being added to the shopping cart by a user in the session. This method should only be used on non-eSales rendered products where no ticket is available.

Parameters

$productKey
product key of the added to cart product or may be null if you have a variant key.
$variantKey
variant key of the variant or null if it is an add to cart on a product only.

Throws

Apptus\ESales\Connector\RequestFailedException
If the notification cannot be sent to the eSales service.
InvalidArgumentException
If productKey or variantKey are empty or both are null.
public
# notifyPayment( Apptus\ESales\Connector\Order $order )

Sends a notification to the eSales service, about products and variants being paid by a user in the session.

Sends a notification to the eSales service, about products and variants being paid by a user in the session.

Parameters

$order
containing the paid products and variants.

Throws

Apptus\ESales\Connector\RequestFailedException
if the notification cannot be sent to the eSales service.
InvalidArgumentException
if order is null or empty
public
# notifyRating( string $productKey, integer $rating )

Sends a notification to the eSales service, about a product being rated.

Sends a notification to the eSales service, about a product being rated.

Parameters

$productKey
key of the rated product.
$rating
rating.

Throws

Apptus\ESales\Connector\RequestFailedException
if the notification cannot be sent to the eSales service.
InvalidArgumentException
if rating is not numeric or if productKey is null or empty
public boolean
# end( )

Notifies the eSales service that the session has ended, and free all resources used by the session on the client-side.

Notifies the eSales service that the session has ended, and free all resources used by the session on the client-side.

Returns

boolean
True if the notification has been sent successfully, false otherwise.
public
# notifyFavoriteAddition( string $productKey, string $variantKey )

Sends a notification to the eSales service, about a product being added to favorites.

Sends a notification to the eSales service, about a product being added to favorites.

Parameters

$productKey
product key of the favorite product or may be null if you have a variant key.
$variantKey
variant key of the favorite. Can be null if a product key is provided. The variant key should always be set if the product has variants.

Throws

Apptus\ESales\Connector\RequestFailedException
If the notification cannot be sent to the eSales service.
InvalidArgumentException
If productKey or variantKey are empty or both are null.
public
# notifyFavoriteRemoval( string $productKey, string $variantKey )

Sends a notification to the eSales service, about a product being removed from favorites.

Sends a notification to the eSales service, about a product being removed from favorites.

Parameters

$productKey
product key of the favorite product or may be null if you have a variant key.
$variantKey
variant key of the favorite. Can be null if a product key is provided. The variant key should always be set if the product has variants.

Throws

Apptus\ESales\Connector\RequestFailedException
If the notification cannot be sent to the eSales service.
InvalidArgumentException
If productKey or variantKey are empty or both are null.
final public string
# key( )

Returns the session key.

Returns the session key.

Returns

string
The session key.
final public string
# market( )

Returns the market.

Returns the market.

Returns

string
The market.
final public string
# customerKey( )

Returns the customer key.

Returns the customer key.

Returns

string
The customer key.
Constants summary
string CUSTOMER_KEY_HEADER_NAME
# 'eSales-customer_key'
string MARKET_HEADER_NAME
# 'eSales-market'
string PROPERTY_MARKET
# 'market'
string PROPERTY_CUSTOMER_KEY
# 'customer_key'
Apptus ESales Connector PHP API documentation generated by ApiGen