Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
EthFilter.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Ethereum\DataType;
4 
8 class EthFilter extends EthDataType
9 {
10  protected $fromBlock;
11  protected $toBlock;
12  protected $address;
13  protected $topics;
14 
22  public function __construct(
24  EthBlockParam $toBlock = null,
25  EthBytes $address = null,
26  Array $topics = null
27  ) {
28  $this->fromBlock = $fromBlock;
29  $this->toBlock = $toBlock;
30  $this->address = $address;
31  $this->topics = $topics;
32  }
33 
34  public function setFromBlock(EthBlockParam $value)
35  {
36  $this->fromBlock = $value;
37  }
38 
39  public function setToBlock(EthBlockParam $value)
40  {
41  $this->toBlock = $value;
42  }
43 
44  public function setAddress(EthBytes $value)
45  {
46  $this->address = $value;
47  }
48 
49  public function setTopics($value)
50  {
51  $this->topics = $value;
52  }
53 
58  public function toArray()
59  {
60  $return = [];
61  (!is_null($this->fromBlock)) ? $return['fromBlock'] = $this->fromBlock->getHexVal() : null;
62  (!is_null($this->toBlock)) ? $return['toBlock'] = $this->toBlock->getHexVal() : null;
63  (!is_null($this->address)) ? $return['address'] = $this->address->getHexVal() : null;
64  (!is_null($this->topics)) ? $return['topics'] = $this->topics->getHexVal() : null;
65 
66  return $return;
67  }
68 }
setFromBlock(EthBlockParam $value)
Definition: EthFilter.php:34
setToBlock(EthBlockParam $value)
Definition: EthFilter.php:39
__construct(EthBlockParam $fromBlock=null, EthBlockParam $toBlock=null, EthBytes $address=null, Array $topics=null)
Definition: EthFilter.php:22
setAddress(EthBytes $value)
Definition: EthFilter.php:44