get_topic_list ( $pcre )

Gets a simple list of Topic ARNs.

Access

public

Parameters

Parameter

Type

Required

Description

$pcre

string

Optional

A Perl-Compatible Regular Expression (PCRE) to filter the names against.

Returns

Type

Description

array

A list of Topic ARNs.

Examples

Get a simple array of Topic ARNs.

$sns = new AmazonSNS();

// List all topics
$response = $sns->get_topic_list();

// Success? (Array, not a CFResponse object)
var_dump($response);

Get a simple array of Topic ARNs, filtered by a regular expression.

$sns = new AmazonSNS();

// List all topics
$response = $sns->get_topic_list('/example-topic/i');

// Success? (Array, not a CFResponse object)
var_dump($response);

See Also

Source

Method defined in services/sns.class.php | Toggle source view (17 lines) | View on GitHub

public function get_topic_list($pcre = null)
{
    if ($this->use_batch_flow)
    {
        throw new SNS_Exception(__FUNCTION__ . '() cannot be batch requested');
    }

    // Get a list of topics.
    $list = $this->list_topics();
    if ($list = $list->body->TopicArn())
    {
        $list = $list->map_string($pcre);
        return $list;
    }

    return array();
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback