Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
RlpCollection.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Ethereum\RLP;
5 
6 
7 class RlpCollection extends Rlp {
8 
9  protected $rlpItems = [];
10 
11  public function toArray() {
12  $return = [];
13  foreach($this->rlpItems as $item) {
14  $return[] = $item->get();
15  }
16  return $return;
17  }
18 
19  public function get() {
20  return $this->rlpItems;
21  }
22 
23  public function add(RlpItem $item) {
24  $this->rlpItems[] = $item;
25  }
26 }