Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
SHHPost.php
Go to the documentation of this file.
1 <?php
11 namespace Ethereum\DataType;
12 
18 class SHHPost extends EthDataType {
19 
23  public $topics;
24 
28  public $payload;
29 
33  public $priority;
34 
38  public $ttl;
39 
43  public $from;
44 
48  public $to;
49 
58  public function __construct(array $topics, EthD $payload, EthQ $priority, EthQ $ttl, EthD $from = null, EthD $to = null) {
59  $this->topics = $topics;
60  $this->payload = $payload;
61  $this->priority = $priority;
62  $this->ttl = $ttl;
63  $this->from = $from;
64  $this->to = $to;
65  }
66 
70  public static function getTypeArray() {
71  return array(
72  'topics' => '[EthD]',
73  'payload' => 'EthD',
74  'priority' => 'EthQ',
75  'ttl' => 'EthQ',
76  'from' => 'EthD',
77  'to' => 'EthD',
78  );
79  }
80 
84  public function toArray() {
85  $return = [];
86  (!is_null($this->topics)) ? $return['topics'] = Ethereum::valueArray($this->topics, 'EthD') : array();
87  (!is_null($this->payload)) ? $return['payload'] = $this->payload->hexVal() : NULL;
88  (!is_null($this->priority)) ? $return['priority'] = $this->priority->hexVal() : NULL;
89  (!is_null($this->ttl)) ? $return['ttl'] = $this->ttl->hexVal() : NULL;
90  (!is_null($this->from)) ? $return['from'] = $this->from->hexVal() : NULL;
91  (!is_null($this->to)) ? $return['to'] = $this->to->hexVal() : NULL;
92  return $return;
93  }
94 }
$priority
Definition: SHHPost.php:33
__construct(array $topics, EthD $payload, EthQ $priority, EthQ $ttl, EthD $from=null, EthD $to=null)
Definition: SHHPost.php:58
$payload
Definition: SHHPost.php:28
$ttl
Definition: SHHPost.php:38
static getTypeArray()
Definition: SHHPost.php:70
$from
Definition: SHHPost.php:43
static valueArray(array $values, string $typeClass)
Definition: Ethereum.php:571
Definition: SHHPost.php:18
toArray()
Definition: SHHPost.php:84
$to
Definition: SHHPost.php:48
$topics
Definition: SHHPost.php:23