![]() |
Antidot PHP API
version 0.16.0
##PHP API to simplify integration of Antidot components
|
Represents an AFS query. More...
Public Member Functions | |
__construct (AfsQueryBase $afs_query=null) | |
Constructs new AFS ACP query object. | |
get_parameters ($all=true) | |
Retrieves query parameters. | |
__get ($name) | |
Add ability to get custom params as member fields. | |
Query management | |
has_query ($feed=null) | |
Checks whether current instance has a query. | |
get_query ($feed=null) | |
Retrieves the query. | |
set_query ($new_query, $feed=null) | |
Assigns new query value. | |
Number of replies management | |
has_replies ($feed=null) | |
Checks whether replies is set. | |
set_replies ($replies_nb, $feed=null) | |
Defines new number of replies. | |
get_replies ($feed=null) | |
Get number of replies per page. | |
Origin of the query | |
auto_set_from ($auto_set=true) | |
Defines whether from parameter should be auto set when possible. | |
set_from ($from, $feed=null) | |
Defines the origin of the query. | |
get_from ($feed=null) | |
Retrieves origin of the query. | |
User and session identifier. | |
These identifiers are used to uniquely identify a user and a corresponding session. | |
set_user_id ($user_id) | |
Defines user id. | |
has_user_id () | |
Checks whether user id is set. | |
get_user_id () | |
Retrieves user identifier. | |
set_session_id ($session_id) | |
Defines session id. | |
has_session_id () | |
Checks whether session id is set. | |
get_session_id () | |
Retrieves session id. | |
initialize_user_and_session_id (AfsUserSessionManager $mgr) | |
Initializes user id and session id. | |
update_user_and_session_id ($user_id, $session_id) | |
Updates user and session identifiers. | |
Logging | |
add_log ($value) | |
Adds new logging information. | |
get_logs () | |
Retrieves current defined logs. | |
Key management | |
has_key ($feed=null) | |
Checks whether key parameter is set. | |
set_key ($key_id, $feed=null) | |
Defines key id. | |
get_key ($feed=null) | |
Retrieves key value. |
Protected Member Functions | |
on_assignment () | |
Action to perform when an assignment occurs. | |
get_relevant_parameters () | |
Retrieves relevant parameters. | |
get_additional_parameters () | |
Retrieves additional parameters. |
Feed management | |
has_feed ($feed=null) | |
Checks whether feed parameter is set. | |
set_feed ($feed) | |
Assigns new feed name replacing any existing one. | |
add_feed ($feed) | |
Assigns new feed name. | |
get_feeds () | |
Retrieves all defined feeds. | |
get_feed ($feed) |
Represents an AFS query.
Derived class of this one:
__construct | ( | AfsQueryBase | $afs_query = null | ) |
Constructs new AFS ACP query object.
$afs_query | [in] instance used for initialization (defaul: create new empty instance). |
add_feed | ( | $feed | ) |
Assigns new feed name.
$feed | [in] new feed to filter on. |
add_log | ( | $value | ) |
Adds new logging information.
This can be used to log your system version or anything else. Version of this API is appended to this list of values.
$value | [in] appended value. |
auto_set_from | ( | $auto_set = true | ) |
Defines whether from
parameter should be auto set when possible.
$auto_set | [in] auto set status (default = true ). |
|
protected |
Retrieves additional parameters.
Derived class should override this method with only its own parameters.
Reimplemented in AfsQuery.
get_feeds | ( | ) |
Retrieves all defined feeds.
get_from | ( | $feed = null | ) |
Retrieves origin of the query.
get_key | ( | $feed = null | ) |
Retrieves key value.
get_logs | ( | ) |
Retrieves current defined logs.
Main purpose of this method is debugging purpose.
get_parameters | ( | $all = true | ) |
Retrieves query parameters.
Retrieves all or relevant parameters. For example, from
parameter is not relevant except for AFS search engine. So, this parameter is not retrieved when all is set to false
.
$all | [in] if set to true , all parameters are retrieved, otherwise only relevent parameters are retrieved. |
get_query | ( | $feed = null | ) |
Retrieves the query.
You should have previously tested whether the instance has a defined query by calling has_query.
|
protected |
Retrieves relevant parameters.
Derived class should override this method with only its own parameters.
Reimplemented in AfsQuery.
get_replies | ( | $feed = null | ) |
Get number of replies per page.
get_session_id | ( | ) |
Retrieves session id.
get_user_id | ( | ) |
Retrieves user identifier.
has_feed | ( | $feed = null | ) |
Checks whether feed parameter is set.
true
when at least one feed is defined, false
otherwise. has_key | ( | $feed = null | ) |
Checks whether key parameter is set.
has_query | ( | $feed = null | ) |
Checks whether current instance has a query.
has_replies | ( | $feed = null | ) |
Checks whether replies is set.
has_session_id | ( | ) |
Checks whether session id is set.
true
and will be removed soon. True
when session id is set, false
otherwise. has_user_id | ( | ) |
Checks whether user id is set.
true
and will be removed soon. True
when user id is set, false
otherwise. initialize_user_and_session_id | ( | AfsUserSessionManager | $mgr | ) |
Initializes user id and session id.
These identifiers are initialized thanks to specific manager. Refers to AfsUserSessionManager for more details. User and session identifiers are updated with identifiers from AfsUserSessionManager when they are available. Otherwise, query identifiers are not modified.
$mgr | [in] Instance of AfsUserSessionManager. |
|
protected |
Action to perform when an assignment occurs.
Nothing is done unless this method is overloaded in child classes.
Reimplemented in AfsQuery.
set_feed | ( | $feed | ) |
Assigns new feed name replacing any existing one.
$feed | [in] new feed to filter on. |
set_from | ( | $from, | |
$feed = null |
|||
) |
Defines the origin of the query.
on_assignment
method is not called by this method.$from | [in] origin of the query. It should be a value defined by AfsOrigin. |
Exception | when provided origin value is invalid. |
set_key | ( | $key_id, | |
$feed = null |
|||
) |
Defines key id.
$key_id | [in] Key id to set. |
set_query | ( | $new_query, | |
$feed = null |
|||
) |
Assigns new query value.
Any previously defined query is replaced by the provided one.
$new_query | [in] query to assign to the instance. |
set_replies | ( | $replies_nb, | |
$feed = null |
|||
) |
Defines new number of replies.
$replies_nb | [in] requested number of replies. It should be greater than or equal to 1. |
Exception | on invalid replies number provided. |
set_session_id | ( | $session_id | ) |
Defines session id.
$session_id | [in] Session id to set. |
set_user_id | ( | $user_id | ) |
Defines user id.
$user_id | [in] User id to set. |
update_user_and_session_id | ( | $user_id, | |
$session_id | |||
) |
Updates user and session identifiers.
These identifiers are updated only if they are not yet defined.
$user_id | [in] user id to set. |
$session_id | [in] session id to set. |