Hoa central
Translate.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Translate;
38 
39 use Hoa\Core;
40 use Hoa\Stream;
41 
50 abstract class Translate implements \IteratorAggregate
51 {
57  protected $_stream = null;
58 
64  protected $_data = [];
65 
66 
67 
74  public function __construct(Stream\IStream\In $stream)
75  {
76  $this->setStream($stream);
77 
78  return;
79  }
80 
87  protected function setStream(Stream\IStream\In $stream)
88  {
89  $old = $this->_stream;
90  $this->_stream = $stream;
91 
92  return $old;
93  }
94 
100  public function getStream()
101  {
102  return $this->_stream;
103  }
104 
111  protected function setData(Array $data)
112  {
113  $old = $this->_data;
114  $this->_data = $data;
115 
116  return $old;
117  }
118 
124  public function getData()
125  {
126  return $this->_data;
127  }
128 
134  public function getIterator()
135  {
136  return new \ArrayIterator($this->_data);
137  }
138 
146  abstract public function _($message);
147 
158  abstract public function _n($message, $n);
159 }
160 
164 Core\Consistency::flexEntity('Hoa\Translate\Translate');
__construct(Stream\IStream\In $stream)
Definition: Translate.php:74
setStream(Stream\IStream\In $stream)
Definition: Translate.php:87
setData(Array $data)
Definition: Translate.php:111