set_response_class ( $class )

Set a custom class for this functionality. Use this method when extending/overriding existing classes with new functionality.

The replacement class must extend from CFResponse.

Access

public

Parameters

Parameter

Type

Required

Description

$class

string

Optional

The name of the new class to use for this functionality.

Returns

Type

Description

$this

A reference to the current instance.

Examples

Set the response class to use in the toolkit.

The new response class must extend from CFResponse.

Note: This method is inherited by all service-specific classes.

// Custom class to extend ResponseCore
class TestResponseCore extends ResponseCore
{
	public function test_method()
	{
		return true;
	}
}

// Instantiate class and set new class
$sdb = new AmazonSDB();
$sdb->set_response_class('TestResponseCore');

// Test if the value was set
var_dump($sdb->response_class);
Result:
string(16) "TestResponseCore"

Source

Method defined in sdk.class.php | Toggle source view (5 lines) | View on GitHub

public function set_response_class($class = 'CFResponse')
{
    $this->response_class = $class;
    return $this;
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback