JanRain OpenID Library

Auth_OpenID_AX_KeyValueMessage extends Auth_OpenID_AX_Message
in package

An abstract class that implements a message that has attribute keys and values. It contains the common code between fetch_response and store_request.

Table of Contents

$mode  : mixed
mode: The type of this attribute exchange message. This must be overridden in subclasses.
$ns_alias  : mixed
$ns_uri  : mixed
ns_uri: The namespace to which to add the arguments for this extension
$data  : array<string|int, mixed>
_checkMode()  : Auth_OpenID_AX_Error|bool
Return Auth_OpenID_AX_Error if the mode in the attribute exchange arguments does not match what is expected for this class; true otherwise.
_getExtensionKpublicgs()  : array<string|int, mixed>
Get the extension arguments for the key/value pairs contained in this message.
_newArgs()  : mixed
Return a set of attribute exchange arguments containing the basic information that must be in every attribute exchange message.
addValue()  : mixed
Add a single value for the given attribute type to the message. If there are already values specified for this type, this value will be sent in addition to the values already specified.
count()  : mixed
Get the number of responses for a particular attribute in this fetch_response message.
get()  : Auth_OpenID_AX_Error|array<string|int, mixed>
Get the list of values for this attribute in the fetch_response.
getExtensionArgs()  : null
Get the string arguments that should be added to an OpenID message for this extension.
getSingle()  : Auth_OpenID_AX_Error|mixed
Get a single value for an attribute. If no value was sent for this attribute, use the supplied default. If there is more than one value for this attribute, this method will fail.
parseExtensionArgs()  : Auth_OpenID_AX_Error|bool
Parse attribute exchange key/value arguments into this object.
setValues()  : mixed
Set the values for the given attribute type. This replaces any values that have already been set for this attribute.
toMessage()  : null
Add the arguments from this extension to the provided message.

Properties

$mode

mode: The type of this attribute exchange message. This must be overridden in subclasses.

public mixed $mode = \null

$ns_uri

ns_uri: The namespace to which to add the arguments for this extension

public mixed $ns_uri = \null

$data

protected array<string|int, mixed> $data = []

Methods

_checkMode()

Return Auth_OpenID_AX_Error if the mode in the attribute exchange arguments does not match what is expected for this class; true otherwise.

public _checkMode(array<string|int, mixed> $ax_args) : Auth_OpenID_AX_Error|bool
Parameters
$ax_args : array<string|int, mixed>
Tags
access

private

Return values
Auth_OpenID_AX_Error|bool

_getExtensionKpublicgs()

Get the extension arguments for the key/value pairs contained in this message.

public _getExtensionKpublicgs(Auth_OpenID_NamespaceMap $aliases) : array<string|int, mixed>
Parameters
$aliases : Auth_OpenID_NamespaceMap

An alias mapping. Set to None if you don't care about the aliases for this request.

Tags
access

private

Return values
array<string|int, mixed>

_newArgs()

Return a set of attribute exchange arguments containing the basic information that must be in every attribute exchange message.

public _newArgs() : mixed
Tags
access

private

Return values
mixed

addValue()

Add a single value for the given attribute type to the message. If there are already values specified for this type, this value will be sent in addition to the values already specified.

public addValue(mixed $type_uri, mixed $value) : mixed
Parameters
$type_uri : mixed
$value : mixed
Return values
mixed

count()

Get the number of responses for a particular attribute in this fetch_response message.

public count(string $type_uri) : mixed
Parameters
$type_uri : string

The URI of the attribute

Tags
returns

int|Auth_OpenID_AX_Error The number of values sent for this attribute. If the attribute was not sent in the response, returns Auth_OpenID_AX_Error.

Return values
mixed

get()

Get the list of values for this attribute in the fetch_response.

public get(string $type_uri) : Auth_OpenID_AX_Error|array<string|int, mixed>

XXX: what to do if the values are not present? default parameter? this is funny because it's always supposed to return a list, so the default may break that, though it's provided by the user's code, so it might be okay. If no default is supplied, should the return be None or []?

Parameters
$type_uri : string

The URI of the attribute

Return values
Auth_OpenID_AX_Error|array<string|int, mixed>

The list of values for this attribute in the response. May be an empty list. If the attribute was not sent in the response, returns Auth_OpenID_AX_Error.

getExtensionArgs()

Get the string arguments that should be added to an OpenID message for this extension.

public getExtensionArgs([Auth_OpenID_Request|null $request = null ]) : null
Parameters
$request : Auth_OpenID_Request|null = null
Return values
null

getSingle()

Get a single value for an attribute. If no value was sent for this attribute, use the supplied default. If there is more than one value for this attribute, this method will fail.

public getSingle(string $type_uri[, mixed $default = null ]) : Auth_OpenID_AX_Error|mixed
Parameters
$type_uri : string

The URI for the attribute

$default : mixed = null

The value to return if the attribute was not sent in the fetch_response.

Return values
Auth_OpenID_AX_Error|mixed

parseExtensionArgs()

Parse attribute exchange key/value arguments into this object.

public parseExtensionArgs(array<string|int, mixed> $ax_args) : Auth_OpenID_AX_Error|bool
Parameters
$ax_args : array<string|int, mixed>

The attribute exchange fetch_response arguments, with namespacing removed.

Return values
Auth_OpenID_AX_Error|bool

setValues()

Set the values for the given attribute type. This replaces any values that have already been set for this attribute.

public setValues(mixed $type_uri, mixed &$values) : mixed
Parameters
$type_uri : mixed
$values : mixed
Return values
mixed

Search results