Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Add.php
Go to the documentation of this file.
1 <?php
7 
13 class Add extends \Magento\Backend\Model\Menu\Builder\AbstractCommand
14 {
20  protected $_requiredParams = ["id", "title", "module", "resource"];
21 
29  public function chain(\Magento\Backend\Model\Menu\Builder\AbstractCommand $command)
30  {
31  if ($command instanceof \Magento\Backend\Model\Menu\Builder\Command\Add) {
32  throw new \InvalidArgumentException("Two 'add' commands cannot have equal id (" . $command->getId() . ")");
33  }
34  return parent::chain($command);
35  }
36 
43  protected function _execute(array $itemParams)
44  {
45  foreach ($this->_data as $key => $value) {
46  $itemParams[$key] = isset($itemParams[$key]) ? $itemParams[$key] : $value;
47  }
48  return $itemParams;
49  }
50 }
$value
Definition: gender.phtml:16
chain(\Magento\Backend\Model\Menu\Builder\AbstractCommand $command)
Definition: Add.php:29