Hoa central
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Hoa\Translate\Translate Class Reference
Inheritance diagram for Hoa\Translate\Translate:

Public Member Functions

 __construct (Stream\IStream\In $stream)
 
 getStream ()
 
 getData ()
 
 getIterator ()
 
 _ ($message)
 
 _n ($message, $n)
 

Protected Member Functions

 setStream (Stream\IStream\In $stream)
 
 setData (Array $data)
 

Protected Attributes

 $_stream = null
 
 $_data = []
 

Detailed Description

Class .

Generic class for translaters.

Definition at line 50 of file Translate.php.

Constructor & Destructor Documentation

Hoa\Translate\Translate::__construct ( Stream\IStream\In  $stream)

Constructor.

Parameters
\Hoa\Stream\IStream\In$streamStream.
Returns
void

Definition at line 74 of file Translate.php.

75  {
76  $this->setStream($stream);
77 
78  return;
79  }
setStream(Stream\IStream\In $stream)
Definition: Translate.php:87

Here is the call graph for this function:

Member Function Documentation

Hoa\Translate\Translate::_ (   $message)
abstract

Get translation for regular message.

Parameters
string$messageMessage.
mixed… Parameters.
Returns
string
Hoa\Translate\Translate::_n (   $message,
  $n 
)
abstract

Get translation for plural messages. Messages are concatenated by NUL (\0), or \0 or ^ They can be escaped by .

Parameters
string$messageMessage.
int$nn (to select the plural).
mixed… Parameters.
Returns
string
Hoa\Translate\Translate::getData ( )

Get messages.

Returns
array

Definition at line 124 of file Translate.php.

125  {
126  return $this->_data;
127  }
Hoa\Translate\Translate::getIterator ( )

Iterate over messages.

Returns

Definition at line 134 of file Translate.php.

135  {
136  return new \ArrayIterator($this->_data);
137  }
Hoa\Translate\Translate::getStream ( )

Get stream.

Returns

Definition at line 100 of file Translate.php.

101  {
102  return $this->_stream;
103  }

Here is the caller graph for this function:

Hoa\Translate\Translate::setData ( Array  $data)
protected

Set messages.

Parameters
array$dataData.
Returns
array

Definition at line 111 of file Translate.php.

112  {
113  $old = $this->_data;
114  $this->_data = $data;
115 
116  return $old;
117  }
Hoa\Translate\Translate::setStream ( Stream\IStream\In  $stream)
protected

Set stream.

Parameters
\Hoa\Stream\IStream\In$streamStream.
Returns

Definition at line 87 of file Translate.php.

88  {
89  $old = $this->_stream;
90  $this->_stream = $stream;
91 
92  return $old;
93  }

Here is the caller graph for this function:

Member Data Documentation

Hoa\Translate\Translate::$_data = []
protected

Definition at line 64 of file Translate.php.

Hoa\Translate\Translate::$_stream = null
protected

Definition at line 57 of file Translate.php.


The documentation for this class was generated from the following file: