Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Folder.php
Go to the documentation of this file.
1 <?php
31 class Zend_Mail_Storage_Folder implements RecursiveIterator
32 {
37  protected $_folders;
38 
43  protected $_localName;
44 
49  protected $_globalName;
50 
55  protected $_selectable = true;
56 
65  public function __construct($localName, $globalName = '', $selectable = true, array $folders = array())
66  {
67  $this->_localName = $localName;
68  $this->_globalName = $globalName ? $globalName : $localName;
69  $this->_selectable = $selectable;
70  $this->_folders = $folders;
71  }
72 
78  public function hasChildren()
79  {
80  $current = $this->current();
81  return $current && $current instanceof Zend_Mail_Storage_Folder && !$current->isLeaf();
82  }
83 
89  public function getChildren()
90  {
91  return $this->current();
92  }
93 
99  public function valid()
100  {
101  return key($this->_folders) !== null;
102  }
103 
109  public function next()
110  {
111  next($this->_folders);
112  }
113 
119  public function key()
120  {
121  return key($this->_folders);
122  }
123 
129  public function current()
130  {
131  return current($this->_folders);
132  }
133 
139  public function rewind()
140  {
141  reset($this->_folders);
142  }
143 
151  public function __get($name)
152  {
153  if (!isset($this->_folders[$name])) {
157  #require_once 'Zend/Mail/Storage/Exception.php';
158  throw new Zend_Mail_Storage_Exception("no subfolder named $name");
159  }
160 
161  return $this->_folders[$name];
162  }
163 
171  public function __set($name, Zend_Mail_Storage_Folder $folder)
172  {
173  $this->_folders[$name] = $folder;
174  }
175 
182  public function __unset($name)
183  {
184  unset($this->_folders[$name]);
185  }
186 
192  public function __toString()
193  {
194  return (string)$this->getGlobalName();
195  }
196 
202  public function getLocalName()
203  {
204  return $this->_localName;
205  }
206 
212  public function getGlobalName()
213  {
214  return $this->_globalName;
215  }
216 
222  public function isSelectable()
223  {
224  return $this->_selectable;
225  }
226 
232  public function isLeaf()
233  {
234  return empty($this->_folders);
235  }
236 }
__set($name, Zend_Mail_Storage_Folder $folder)
Definition: Folder.php:171
__construct($localName, $globalName='', $selectable=true, array $folders=array())
Definition: Folder.php:65
if(!isset($_GET['name'])) $name
Definition: log.php:14