Interface Inx_Api_DataAccess_DataAccess

Description

An Inx_Api_DataAccess_DataAccess object can be used to retrieve data regarding links and clicks.

An Inx_Api_DataAccess_DataAccess object can be used to retrieve data regarding links and clicks. Link data can be retrieved using an Inx_Api_DataAccess_LinkData object, click data by using an Inx_Api_DataAccess_ClickData object. Both can be obtained via this class. An Inx_Api_DataAccess_LinkData object can retrieve link data with the following filters:

  • Link id: fetches a link by its unique identifier.
  • Link name: fetches a link by its name.
  • Link type: fetches a link by its type.
  • Link name set: fetches links which name is set or not set.
  • Mailing id: fetches all links used in the specified mailing.
  • Recipient id: fetches all links the specified user has clicked.

An Inx_Api_DataAccess_ClickData object can retrieve click data with the following filters:

  • Mailing id: fetches all clicks of links of the specified mailing.
  • Recipient id: fetches all clicks performed by the specified recipient.
  • Mailing + Recipient id: combination of the two above filters.
  • Link id: fetches all clicks of the specified link.
  • Link type: fetches all clicks of links of the specified type.
  • Sending id: fetches all clicks associated with the sending id.
  • Time: fetches all clicks in a certain time span.
All of the click data filters can be combined with a date filter: before, after or between.

Inx_Api_DataAccess_LinkData and Inx_Api_DataAccess_ClickData retrieve the information as result set: Inx_Api_DataAccess_LinkDataRowSet for link data and Inx_Api_DataAccess_ClickDataRowSet for click data. Using these result sets it is easy to navigate through the data retrieved by the various methods.

The following snippet returns an Inx_Api_DataAccess_LinkDataRowSet containing all link data for the given recipient id:

 $oDataAccess = $oSession->getDataAccess();
 $oLinkData = $oDataAccess->getLinkDataWithNewLinkType();
 ...
 $oLinkDataRowSet = $oLinkData->selectByRecipient( $iId );

The following snippet returns an Inx_Api_DataAccess_ClickDataRowSet containing all click data for the given recipient id:

 $oDataAccess = $oSession->getDataAccess();
 $oClickData = $oDataAccess->getClickData();
 $oRecipientContext = $oSession->createRecipientContext();
 $oEmail = $oRecipientContext->getMetaData()->getEmailAttribute();
 ...
 ClickDataRowSet rowSet = cd.selectByRecipient( id, rc, new Attribute[]{email} );

API version 1.11.1 allows you to filter by the type of the clicked link and to retrieve all clicks filtered only by date. Offering all possible combinations would have made figuring out which method is the right one a tedious job. Therefore, these filter types are only available using the new fluent query interface. The query API also allows to specify arrays of IDs. The following snippet demonstrates how to filter the clicks by two mailings, two link types and a start date:

 $oDataAccess = $oSession->getDataAccess();
 $oClickData = $oDataAccess->getClickData();
 $oRecipientContext = $oSession->createRecipientContext();
 $oEmail = $oRecipientContext->getMetaData()->getEmailAttribute();

 $aMailingIds = array( 1234, 4711 );
 $aLinkTypes = array( Inx_Api_DataAccess_LinkDataRowSet::LINK_TYPE_UNIQUE_COUNT,
      Inx_Api_DataAccess_LinkDataRowSet::LINK_TYPE_OPENING_COUNT );
 $sOneDayAgo = date( 'c', strtotime( '-1 day' ) );
 ...
 $oClickDataQuery = $oClickData->createQuery( $oRecipientContext, array( email ) );
 $oClickDataRowSet = $oClickDataQuery->mailings( $aMailingIds )->linkTypes( $aLinkTypes )->after( $sOneDayAgo ).executeQuery();

API version 1.12.1 allows you to filter links with a fluent query interface, similar to the fluent query interface for selecting clicks. Filter options newly available with this API version are only accessible through the new query. The following snipped demonstrates by example how to filter links with the new fluent query interface.:

 $oQuery = session->getDataAccess()->getLinkDataWithNewLinkType()->createQuery();
 $oResult = $oQuery->linkType(Inx_Api_DataAccess_LinkDataRowSet::LINK_TYPE_UNIQUE_COUNT)->
      recipientIds(array(1001, 1002))->executeQuery();

Note: All data provided by Inx_Api_DataAccess_DataAccess is read only!

For more information about link and click data, see the Inx_Api_DataAccess_LinkData and Inx_Api_DataAccess_ClickData documentation.

Located in /Api/DataAccess/DataAccess.php (line 100)


	
			
Method Summary
Methods
getClickData (line 127)

Returns the click data object which can be used to access the click data.

Returns the click data object which can be used to access the click data.

  • return: the click data object.
  • access: public
getLinkData (line 109)

Returns the link data object which can used to access the link data.

Returns the link data object which can used to access the link data.

  • return: the link data object.
  • deprecated: old behavior is, that uniquely counted image links are counted as unique links. The new method getLinkDataWithNewLinkType() returns them separated in unique-count and opening-count links.
  • access: public
getLinkDataWithNewLinkType (line 119)

Returns the link data object which can used to access the link data. In this method unique counted image links are not counted as unique links. opening-count.

Returns the link data object which can used to access the link data.
In this method unique counted image links are not counted as unique links. These links have the new type opening-count.

  • return: the link data object.
  • access: public
Inx_Api_DataAccess_LinkData getLinkDataWithNewLinkType ()

Documentation generated on Thu, 17 Sep 2015 14:27:23 +0200 by phpDocumentor 1.3.2