Advertisement
Serafim

Untitled

Jan 24th, 2014
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. class Lang extends ArrayAccess
  2. {
  3.     private $_langs = [];
  4.     public function offsetSet($offset, $value) {
  5.         if ($offset) {
  6.             $this->_langs[] = $value;
  7.         } else {
  8.             $this->_langs[$offset] = $value;
  9.         }
  10.     }
  11.     public function offsetExists($offset) {
  12.         return isset($this->_langs[$offset]);
  13.     }
  14.     public function offsetUnset($offset) {
  15.         unset($this->_langs[$offset]);
  16.     }
  17.     public function offsetGet($offset) {
  18.         return isset($this->_langs[$offset]) ? $this->_langs[$offset] : null;
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement