PHP Интерфейс Falcon_Handler, Falcon

Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
__construct ( array $options ) Construct the handler
check_inbox ( ) Check the inbox for replies
get_name ( ) : string Get a human-readable name for the handler
handle_post ( )
options_section_header ( ) Output a description for the options
register_option_fields ( string $group, string $section, array $options ) Register handler-specific option fields
send_mail ( array $users, Falcon_Message $message ) : array | null Send a message to specified recipients
supports_message_ids ( ) : boolean Does the handler support custom message IDs?
validate_options ( array $input ) : array Validate the options from the submitted form

Описание методов

__construct() публичный Метод

This method should set up your handler completely and ensure that it's ready to start handling sending and receiving data. If the supplied options are invalid, throw an exception with the message set to a human-readable description; it will be displayed to the user on pageload.
public __construct ( array $options )
$options array Handler-specific options, saved via {@see \validate_options}

check_inbox() публичный Метод

Check the inbox for replies
public check_inbox ( )

get_name() публичный статический Метод

This is used for the handler selector and is shown to the user.
public static get_name ( ) : string
Результат string

handle_post() публичный Метод

public handle_post ( )

options_section_header() публичный статический Метод

If you have any extra information you want to tell the user, this is probably the best place for it to live.
public static options_section_header ( )

register_option_fields() публичный статический Метод

This method is expected to call add_settings_field() as many times as needed for the relevant option fields. The $group and $section params are the 4th and 5th parameters to add_settings_field() respectively. e.g. add_settings_field('bbsub_postmark_apikey', 'Postmark API Key', array(__CLASS__, 'field_apikey'), $group, $section) Note that you need to use "bbsub_handler_options" as the name of the POST variable in your callback. e.g. echo ';
public static register_option_fields ( string $group, string $section, array $options )
$group string Settings group (4th parameter to `add_settings_field`)
$section string Settings section (5th parameter to `add_settings_field`)
$options array Current options

send_mail() публичный Метод

Send a message to specified recipients
public send_mail ( array $users, Falcon_Message $message ) : array | null
$users array Users to notify
$message Falcon_Message Message to send
Результат array | null Map of user ID to message ID, or empty if IDs are not available.

supports_message_ids() публичный статический Метод

Falcon can operate in one of two modes: 1. Leader Mode - Falcon will set the message ID for each message, and assume full control over them for threading purposes. 2. Follower Mode - Falcon will observe message IDs set by the handler, and use them internally. Where possible, use leader mode, as this has cleaner handling. However, not all handlers support custom message IDs, so follower mode must exist for these.
public static supports_message_ids ( ) : boolean
Результат boolean True to operate in leader mode, false to operate in follower mode.

validate_options() публичный статический Метод

This method takes the values of the POSTed values for bbsub_handler_options and is expected to return a sanitized version. The sanitized values will be passed into the handler's constructor.
public static validate_options ( array $input ) : array
$input array Raw POSTed data
Результат array Sanitized POST data