SnsCredentials implements ArrayCopyable, Arrayable, Jsonable Uses ArrayTrait, JsonTrait
SNS credentials.
Interfaces, Classes and Traits
- ArrayCopyable
- Interface to declare instances can be converted into/from arrays.
- Arrayable
- Interface to declare that instances can be converted into an array.
- Jsonable
- Interface to declare that instances can be converted into JSON strings.
Table of Contents
- copyFromArray() : mixed
- Copy the content of the given array into this object.
- copyToArray() : mixed
- Copy the content of this object into the given array.
- fromArray() : static
- Convert an array into an instance of this class.
- fromJson() : static
- Convert a JSON string into an instance of this class.
- getApikey() : string
- Get the API key assigned by the SNS.
- getApiSecret() : string
- Get the API secret assigned by the SNS.
- getSns() : Sns
- Get the identifier of the SNS.
- setApiKey() : SnsCredentials
- Set the API key assigned by the SNS.
- setApiSecret() : SnsCredentials
- Set the API secret assigned by the SNS.
- setSns() : SnsCredentials
- Set the identifier of the SNS.
- toArray() : array<string|int, mixed>
- Convert this object into an array.
- toJson() : string
- Convert this object into a JSON string.
Methods
copyFromArray()
Copy the content of the given array into this object.
public
copyFromArray(array<string|int, mixed> &$array) : mixed
Parameters
- $array : array<string|int, mixed>
Return values
mixed —copyToArray()
Copy the content of this object into the given array.
public
copyToArray(array<string|int, mixed> &$array) : mixed
Parameters
- $array : array<string|int, mixed>
Return values
mixed —fromArray()
Convert an array into an instance of this class.
public
static fromArray([array<string|int, mixed> $array = null ]) : static
This static function returns a new instance of this class.
If $array
is null
, null
is returned.
Parameters
- $array : array<string|int, mixed> = null
-
An array
Return values
static —An instance of this class.
fromJson()
Convert a JSON string into an instance of this class.
public
static fromJson(string $json) : static
This static function returns a new instance of this class.
If $json
is null
or the type of $json
is not string
,
null
is returned.
Parameters
- $json : string
-
A JSON string.
Return values
static —An instance of this class.
getApikey()
Get the API key assigned by the SNS.
public
getApikey() : string
Return values
string —The API key assigned by the SNS.
getApiSecret()
Get the API secret assigned by the SNS.
public
getApiSecret() : string
Return values
string —The API secret assigned by the SNS.
getSns()
Get the identifier of the SNS.
public
getSns() : Sns
Return values
Sns —The identifier of the SNS.
setApiKey()
Set the API key assigned by the SNS.
public
setApiKey(string $apiKey) : SnsCredentials
Parameters
- $apiKey : string
-
The API key assigned by the SNS.
Return values
SnsCredentials —$this
object.
setApiSecret()
Set the API secret assigned by the SNS.
public
setApiSecret(string $apiSecret) : SnsCredentials
Parameters
- $apiSecret : string
-
The API secret assigned by the SNS.
Return values
SnsCredentials —$this
object.
setSns()
Set the identifier of the SNS.
public
setSns([Sns $sns = null ]) : SnsCredentials
Parameters
- $sns : Sns = null
-
The identifier of the SNS.
Return values
SnsCredentials —$this
object.
toArray()
Convert this object into an array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array.
toJson()
Convert this object into a JSON string.
public
toJson(int $options) : string
Parameters
- $options : int
-
Options passed to
json_encode()
. This parameter is optional and its default value is 0.
Return values
string —A JSON string.