Antidot PHP API  version 0.16.0
##PHP API to simplify integration of Antidot components
 All Classes Files Functions Variables Groups Pages
Public Member Functions | List of all members
AfsPromoteReplyHelper Class Reference

Promote helper to manager title, abstract and uri of one reply. More...

Inheritance diagram for AfsPromoteReplyHelper:
AfsBaseReplyHelper AfsHelperBase AfsPromoteBannerReplyHelper

Public Member Functions

 __construct ($reply)
 Constructs new instance.
 get_type ()
 get the current promote instance type, types are default, banner or redirect
 get_custom_data ($key=null)
 Retrieves custom data from promote reply. To call this method, get_type should return 'default'.
- Public Member Functions inherited from AfsBaseReplyHelper
 __construct ($reply, AfsTextVisitorInterface $visitor)
 Constructs new instance.
 get_title ()
 Retrieves formatted title reply.
 get_abstract ()
 Retrieves formatted abstract reply.
 get_uri ()
 Retrieves URI of the document.
 format ()
 Retrieves reply data as array.
- Public Member Functions inherited from AfsHelperBase
 __get ($name)
 Simple property helper.

Detailed Description

Promote helper to manager title, abstract and uri of one reply.

You are highly encouraged to use this helper to format Promote replies.

This helper use same visitor for both title and abstract reply. If none is defined while constructing instance, default implementation is used (see AfsTextVisitor).

In order to deal with client data, you should have to use specific AfsClientDataManager.

Constructor & Destructor Documentation

__construct (   $reply)

Constructs new instance.

Parameters
$reply[in] one reply used to initialize the instance.

Reimplemented in AfsPromoteBannerReplyHelper.

Member Function Documentation

get_custom_data (   $key = null)

Retrieves custom data from promote reply. To call this method, get_type should return 'default'.

Parameters
$key[in] Identifier of the custom resource. When not specified custom data are returned as key/value pairs.
Returns
value(s) associated to specified key or all key/value pairs.
Exceptions
Exceptionno custom data has been defined.
get_type ( )

get the current promote instance type, types are default, banner or redirect

Returns
string 'default', 'banner' or 'redirect'

Reimplemented in AfsPromoteBannerReplyHelper.