Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Proxy.php
Go to the documentation of this file.
1 <?php
7 
13 {
19  protected $_objectManager = null;
20 
26  protected $_instanceName = null;
27 
33  protected $_subject = null;
34 
40  protected $_isShared = null;
41 
49  public function __construct(
51  $instanceName = \Magento\Framework\View\Layout::class,
52  $shared = true
53  ) {
54  $this->_objectManager = $objectManager;
55  $this->_instanceName = $instanceName;
56  $this->_isShared = $shared;
57  }
58 
62  public function __sleep()
63  {
64  return ['_subject', '_isShared'];
65  }
66 
72  public function __wakeup()
73  {
74  $this->_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
75  }
76 
82  public function __clone()
83  {
84  $this->_subject = clone $this->_getSubject();
85  }
86 
92  protected function _getSubject()
93  {
94  if (!$this->_subject) {
95  $this->_subject = true === $this->_isShared
96  ? $this->_objectManager->get($this->_instanceName)
97  : $this->_objectManager->create($this->_instanceName);
98  }
99  return $this->_subject;
100  }
101 
106  {
107  return $this->_getSubject()->setGeneratorPool($generatorPool);
108  }
109 
114  {
115  return $this->_getSubject()->setBuilder($builder);
116  }
117 
121  public function publicBuild()
122  {
123  $this->_getSubject()->publicBuild();
124  }
125 
129  public function getUpdate()
130  {
131  return $this->_getSubject()->getUpdate();
132  }
133 
137  public function generateXml()
138  {
139  return $this->_getSubject()->generateXml();
140  }
141 
145  public function generateElements()
146  {
147  $this->_getSubject()->generateElements();
148  }
149 
153  public function getChildBlock($parentName, $alias)
154  {
155  return $this->_getSubject()->getChildBlock($parentName, $alias);
156  }
157 
161  public function setChild($parentName, $elementName, $alias)
162  {
163  return $this->_getSubject()->setChild($parentName, $elementName, $alias);
164  }
165 
169  public function reorderChild($parentName, $childName, $offsetOrSibling, $after = true)
170  {
171  $this->_getSubject()->reorderChild($parentName, $childName, $offsetOrSibling, $after);
172  }
173 
177  public function unsetChild($parentName, $alias)
178  {
179  return $this->_getSubject()->unsetChild($parentName, $alias);
180  }
181 
185  public function getChildNames($parentName)
186  {
187  return $this->_getSubject()->getChildNames($parentName);
188  }
189 
193  public function getChildBlocks($parentName)
194  {
195  return $this->_getSubject()->getChildBlocks($parentName);
196  }
197 
201  public function getChildName($parentName, $alias)
202  {
203  return $this->_getSubject()->getChildName($parentName, $alias);
204  }
205 
209  public function renderElement($name, $useCache = true)
210  {
211  return $this->_getSubject()->renderElement($name, $useCache);
212  }
213 
217  public function renderNonCachedElement($name)
218  {
219  return $this->_getSubject()->renderNonCachedElement($name);
220  }
221 
225  public function addToParentGroup($blockName, $parentGroupName)
226  {
227  return $this->_getSubject()->addToParentGroup($blockName, $parentGroupName);
228  }
229 
233  public function getGroupChildNames($blockName, $groupName)
234  {
235  return $this->_getSubject()->getGroupChildNames($blockName, $groupName);
236  }
237 
241  public function hasElement($name)
242  {
243  return $this->_getSubject()->hasElement($name);
244  }
245 
250  {
251  return $this->_getSubject()->getElementProperty($name, $attribute);
252  }
253 
257  public function isBlock($name)
258  {
259  return $this->_getSubject()->isBlock($name);
260  }
261 
265  public function isUiComponent($name)
266  {
267  return $this->_getSubject()->isUiComponent($name);
268  }
269 
273  public function isContainer($name)
274  {
275  return $this->_getSubject()->isContainer($name);
276  }
277 
281  public function isManipulationAllowed($name)
282  {
283  return $this->_getSubject()->isManipulationAllowed($name);
284  }
285 
289  public function setBlock($name, $block)
290  {
291  return $this->_getSubject()->setBlock($name, $block);
292  }
293 
297  public function unsetElement($name)
298  {
299  return $this->_getSubject()->unsetElement($name);
300  }
301 
305  public function createBlock($type, $name = '', array $arguments = [])
306  {
307  return $this->_getSubject()->createBlock($type, $name, $arguments);
308  }
309 
313  public function addBlock($block, $name = '', $parent = '', $alias = '')
314  {
315  return $this->_getSubject()->addBlock($block, $name, $parent, $alias);
316  }
317 
321  public function addContainer($name, $label, array $options = [], $parent = '', $alias = '')
322  {
323  $this->_getSubject()->addContainer($name, $label, $options, $parent, $alias);
324  }
325 
329  public function renameElement($oldName, $newName)
330  {
331  return $this->_getSubject()->renameElement($oldName, $newName);
332  }
333 
337  public function getAllBlocks()
338  {
339  return $this->_getSubject()->getAllBlocks();
340  }
341 
345  public function getBlock($name)
346  {
347  return $this->_getSubject()->getBlock($name);
348  }
349 
353  public function getUiComponent($name)
354  {
355  return $this->_getSubject()->getUiComponent($name);
356  }
357 
361  public function getParentName($childName)
362  {
363  return $this->_getSubject()->getParentName($childName);
364  }
365 
369  public function getElementAlias($name)
370  {
371  return $this->_getSubject()->getElementAlias($name);
372  }
373 
377  public function addOutputElement($name)
378  {
379  return $this->_getSubject()->addOutputElement($name);
380  }
381 
385  public function removeOutputElement($name)
386  {
387  return $this->_getSubject()->removeOutputElement($name);
388  }
389 
393  public function getOutput()
394  {
395  return $this->_getSubject()->getOutput();
396  }
397 
401  public function getMessagesBlock()
402  {
403  return $this->_getSubject()->getMessagesBlock();
404  }
405 
409  public function getBlockSingleton($type)
410  {
411  return $this->_getSubject()->getBlockSingleton($type);
412  }
413 
417  public function addAdjustableRenderer($namespace, $staticType, $dynamicType, $type, $template, $data = [])
418  {
419  return $this->_getSubject()->addAdjustableRenderer(
420  $namespace,
421  $staticType,
422  $dynamicType,
423  $type,
424  $template,
425  $data
426  );
427  }
428 
432  public function getRendererOptions($namespace, $staticType, $dynamicType)
433  {
434  return $this->_getSubject()->getRendererOptions($namespace, $staticType, $dynamicType);
435  }
436 
440  public function executeRenderer($namespace, $staticType, $dynamicType, $data = [])
441  {
442  $this->_getSubject()->executeRenderer($namespace, $staticType, $dynamicType, $data);
443  }
444 
448  public function initMessages($messageGroups = [])
449  {
450  $this->_getSubject()->initMessages($messageGroups);
451  }
452 
456  public function isCacheable()
457  {
458  return $this->_getSubject()->isCacheable();
459  }
460 
464  public function isPrivate()
465  {
466  return $this->_getSubject()->isPrivate();
467  }
468 
472  public function setIsPrivate($isPrivate = true)
473  {
474  return $this->_getSubject()->setIsPrivate($isPrivate);
475  }
476 
480  public function getReaderContext()
481  {
482  return $this->_getSubject()->getReaderContext();
483  }
484 
488  public function setXml(\Magento\Framework\Simplexml\Element $node)
489  {
490  return $this->_getSubject()->setXml($node);
491  }
492 
496  public function getNode($path = null)
497  {
498  return $this->_getSubject()->getNode($path);
499  }
500 
504  public function getXpath($xpath)
505  {
506  return $this->_getSubject()->getXpath($xpath);
507  }
508 
512  public function getXmlString()
513  {
514  return $this->_getSubject()->getXmlString();
515  }
516 
520  public function loadFile($filePath)
521  {
522  return $this->_getSubject()->loadFile($filePath);
523  }
524 
528  public function loadString($string)
529  {
530  return $this->_getSubject()->loadString($string);
531  }
532 
536  public function loadDom(\DOMNode $dom)
537  {
538  return $this->_getSubject()->loadDom($dom);
539  }
540 
544  public function setNode($path, $value, $overwrite = true)
545  {
546  return $this->_getSubject()->setNode($path, $value, $overwrite);
547  }
548 
552  public function applyExtends()
553  {
554  return $this->_getSubject()->applyExtends();
555  }
556 
560  public function processFileData($text)
561  {
562  return $this->_getSubject()->processFileData($text);
563  }
564 
568  public function extend(\Magento\Framework\Simplexml\Config $config, $overwrite = true)
569  {
570  return $this->_getSubject()->extend($config, $overwrite);
571  }
572 }
getChildBlock($parentName, $alias)
Definition: Proxy.php:153
reorderChild($parentName, $childName, $offsetOrSibling, $after=true)
Definition: Proxy.php:169
initMessages($messageGroups=[])
Definition: Proxy.php:448
getRendererOptions($namespace, $staticType, $dynamicType)
Definition: Proxy.php:432
unsetChild($parentName, $alias)
Definition: Proxy.php:177
$objectManager
Definition: bootstrap.php:17
addBlock($block, $name='', $parent='', $alias='')
Definition: Proxy.php:313
$config
Definition: fraud_order.php:17
setNode($path, $value, $overwrite=true)
Definition: Proxy.php:544
endifif( $block->getLastPageNum()>1)( 'Page') ?></strong >< ul class $text
Definition: pager.phtml:43
setXml(\Magento\Framework\Simplexml\Element $node)
Definition: Proxy.php:488
extend(\Magento\Framework\Simplexml\Config $config, $overwrite=true)
Definition: Proxy.php:568
setChild($parentName, $elementName, $alias)
Definition: Proxy.php:161
$block
Definition: block.php:8
renameElement($oldName, $newName)
Definition: Proxy.php:329
getGroupChildNames($blockName, $groupName)
Definition: Proxy.php:233
getChildName($parentName, $alias)
Definition: Proxy.php:201
$type
Definition: item.phtml:13
$label
Definition: details.phtml:21
$value
Definition: gender.phtml:16
executeRenderer($namespace, $staticType, $dynamicType, $data=[])
Definition: Proxy.php:440
setGeneratorPool(\Magento\Framework\View\Layout\GeneratorPool $generatorPool)
Definition: Proxy.php:105
addContainer($name, $label, array $options=[], $parent='', $alias='')
Definition: Proxy.php:321
addAdjustableRenderer($namespace, $staticType, $dynamicType, $type, $template, $data=[])
Definition: Proxy.php:417
addToParentGroup($blockName, $parentGroupName)
Definition: Proxy.php:225
__construct(\Magento\Framework\ObjectManagerInterface $objectManager, $instanceName=\Magento\Framework\View\Layout::class, $shared=true)
Definition: Proxy.php:49
renderElement($name, $useCache=true)
Definition: Proxy.php:209
createBlock($type, $name='', array $arguments=[])
Definition: Proxy.php:305
$arguments
getElementProperty($name, $attribute)
Definition: Proxy.php:249
if(!trim($html)) $alias
Definition: details.phtml:20
setBuilder(\Magento\Framework\View\Layout\BuilderInterface $builder)
Definition: Proxy.php:113
$template
Definition: export.php:12
$elementName
Definition: gallery.phtml:10
if(!isset($_GET['name'])) $name
Definition: log.php:14
setIsPrivate($isPrivate=true)
Definition: Proxy.php:472