Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
Filter.php
Go to the documentation of this file.
1 <?php
11 namespace Ethereum\DataType;
12 
18 class Filter extends EthDataType {
19 
23  public $fromBlock;
24 
28  public $toBlock;
29 
33  public $address;
34 
38  public $topics;
39 
46  public function __construct(EthBlockParam $fromBlock = null, EthBlockParam $toBlock = null, EthBytes $address = null, array $topics = null) {
47  $this->fromBlock = $fromBlock;
48  $this->toBlock = $toBlock;
49  $this->address = $address;
50  $this->topics = $topics;
51  }
52 
56  public static function getTypeArray() {
57  return array(
58  'fromBlock' => 'EthBlockParam',
59  'toBlock' => 'EthBlockParam',
60  'address' => 'EthBytes',
61  'topics' => '[EthD]',
62  );
63  }
64 
68  public function toArray() {
69  $return = [];
70  (!is_null($this->fromBlock)) ? $return['fromBlock'] = $this->fromBlock->hexVal() : NULL;
71  (!is_null($this->toBlock)) ? $return['toBlock'] = $this->toBlock->hexVal() : NULL;
72  (!is_null($this->address)) ? $return['address'] = $this->address->hexVal() : NULL;
73  (!is_null($this->topics)) ? $return['topics'] = Ethereum::valueArray($this->topics, 'EthD') : array();
74  return $return;
75  }
76 }
static valueArray(array $values, string $typeClass)
Definition: Ethereum.php:571
__construct(EthBlockParam $fromBlock=null, EthBlockParam $toBlock=null, EthBytes $address=null, array $topics=null)
Definition: Filter.php:46