Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
Bundle Class Reference
Inheritance diagram for Bundle:
Widget TabInterface Template Template AbstractBlock DataObject BlockInterface

Public Member Functions

 __construct (\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Registry $registry, array $data=[])
 
 getTabUrl ()
 
 getTabClass ()
 
 isReadonly ()
 
 getAddButtonHtml ()
 
 getOptionsBoxHtml ()
 
 getFieldSuffix ()
 
 getProduct ()
 
 getTabLabel ()
 
 getTabTitle ()
 
 canShowTab ()
 
 isHidden ()
 
 getParentTab ()
 
- Public Member Functions inherited from Widget
 getId ()
 
 getSuffixId ($suffix)
 
 getHtmlId ()
 
 getCurrentUrl ($params=[])
 
 getButtonHtml ($label, $onclick, $class='', $buttonId=null, $dataAttr=[])
 
- Public Member Functions inherited from Template
 __construct (\Magento\Backend\Block\Template\Context $context, array $data=[])
 
 getFormKey ()
 
 isOutputEnabled ($moduleName=null)
 
 getAuthorization ()
 
 getToolbar ()
 
- Public Member Functions inherited from Template
 __construct (Template\Context $context, array $data=[])
 
 setTemplateContext ($templateContext)
 
 getTemplate ()
 
 setTemplate ($template)
 
 getTemplateFile ($template=null)
 
 getArea ()
 
 assign ($key, $value=null)
 
 fetchView ($fileName)
 
 getBaseUrl ()
 
 getObjectData (\Magento\Framework\DataObject $object, $key)
 
 getCacheKeyInfo ()
 
- Public Member Functions inherited from AbstractBlock
 __construct (\Magento\Framework\View\Element\Context $context, array $data=[])
 
 getJsLayout ()
 
 getRequest ()
 
 getParentBlock ()
 
 setLayout (\Magento\Framework\View\LayoutInterface $layout)
 
 getLayout ()
 
 setNameInLayout ($name)
 
 getChildNames ()
 
 setAttribute ($name, $value=null)
 
 setChild ($alias, $block)
 
 addChild ($alias, $block, $data=[])
 
 unsetChild ($alias)
 
 unsetCallChild ($alias, $callback, $result, $params)
 
 unsetChildren ()
 
 getChildBlock ($alias)
 
 getChildHtml ($alias='', $useCache=true)
 
 getChildChildHtml ($alias, $childChildAlias='', $useCache=true)
 
 getBlockHtml ($name)
 
 insert ($element, $siblingName=0, $after=true, $alias='')
 
 append ($element, $alias='')
 
 getGroupChildNames ($groupName)
 
 getChildData ($alias, $key='')
 
 getUiId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null)
 
 getJsId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null)
 
 getUrl ($route='', $params=[])
 
 getViewFileUrl ($fileId, array $params=[])
 
 formatDate ( $date=null, $format=\IntlDateFormatter::SHORT, $showTime=false, $timezone=null)
 
 formatTime ( $time=null, $format=\IntlDateFormatter::SHORT, $showDate=false)
 
 getModuleName ()
 
 escapeHtml ($data, $allowedTags=null)
 
 escapeJs ($string)
 
 escapeHtmlAttr ($string, $escapeSingleQuote=true)
 
 escapeCss ($string)
 
 stripTags ($data, $allowableTags=null, $allowHtmlEntities=false)
 
 escapeUrl ($string)
 
 escapeXssInUrl ($data)
 
 escapeQuote ($data, $addSlashes=false)
 
 escapeJsQuote ($data, $quote='\'')
 
 getNameInLayout ()
 
 getCacheKeyInfo ()
 
 getCacheKey ()
 
 getVar ($name, $module=null)
 
 isScopePrivate ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Public Member Functions inherited from BlockInterface
 toHtml ()
 

Protected Member Functions

 _prepareLayout ()
 
- Protected Member Functions inherited from Widget
 _addBreadcrumb ($label, $title=null, $link=null)
 
- Protected Member Functions inherited from Template
 _toHtml ()
 
- Protected Member Functions inherited from Template
 _construct ()
 
 _toHtml ()
 
 getRootDirectory ()
 
 getMediaDirectory ()
 
- Protected Member Functions inherited from AbstractBlock
 _construct ()
 
 _prepareLayout ()
 
 _beforeToHtml ()
 
 _afterToHtml ($html)
 
 _toHtml ()
 
 _getNotFoundUrl ($route='', $params=['_direct'=> 'core/index/notFound'])
 
 getCacheTags ()
 
 getCacheLifetime ()
 
 _loadCache ()
 
 _saveCache ($data)
 
 _getSidPlaceholder ($cacheKey=null)
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 

Protected Attributes

 $_product = null
 
 $_template = 'Magento_Bundle::product/edit/bundle.phtml'
 
 $_coreRegistry = null
 
- Protected Attributes inherited from Template
 $_authorization
 
 $mathRandom
 
 $_backendSession
 
 $formKey
 
 $nameBuilder
 
- Protected Attributes inherited from Template
 $_viewVars = []
 
 $_baseUrl
 
 $_jsUrl
 
 $_allowSymlinks
 
 $_filesystem
 
 $_template
 
 $templateEnginePool
 
 $_storeManager
 
 $_appState
 
 $directory
 
 $templateContext
 
 $pageConfig
 
 $resolver
 
 $validator
 
- Protected Attributes inherited from AbstractBlock
 $_design
 
 $_session
 
 $_sidResolver
 
 $_nameInLayout
 
 $_layout
 
 $jsLayout = []
 
 $_request
 
 $_urlBuilder
 
 $_eventManager
 
 $_frontController
 
 $_assetRepo
 
 $_viewConfig
 
 $_cacheState
 
 $_logger
 
 $_escaper
 
 $filterManager
 
 $_localeDate
 
 $inlineTranslation
 
 $_isScopePrivate = false
 
 $_scopeConfig
 
 $_cache
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractBlock
static extractModuleName ($className)
 
- Data Fields inherited from Template
const XML_PATH_TEMPLATE_ALLOW_SYMLINK = 'dev/template/allow_symlink'
 
- Data Fields inherited from AbstractBlock
const CACHE_GROUP = \Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER
 
const CACHE_KEY_PREFIX = 'BLOCK_'
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Adminhtml catalog product bundle items tab block

Author
Magento Core Team core@.nosp@m.mage.nosp@m.ntoco.nosp@m.mmer.nosp@m.ce.co.nosp@m.m

Definition at line 13 of file Bundle.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Backend\Block\Template\Context  $context,
\Magento\Framework\Registry  $registry,
array  $data = [] 
)
Parameters
\Magento\Backend\Block\Template\Context$context
\Magento\Framework\Registry$registry
array$data

Definition at line 37 of file Bundle.php.

41  {
42  $this->_coreRegistry = $registry;
43  parent::__construct($context, $data);
44  }

Member Function Documentation

◆ _prepareLayout()

_prepareLayout ( )
protected

Prepare layout

Returns
$this

Definition at line 67 of file Bundle.php.

68  {
69  $this->setData('opened', true);
70  $this->addChild(
71  'add_button',
72  \Magento\Backend\Block\Widget\Button::class,
73  [
74  'label' => __('Create New Option'),
75  'class' => 'add',
76  'id' => 'add_new_option',
77  'on_click' => 'bOption.add()'
78  ]
79  );
80 
81  $this->setChild(
82  'options_box',
83  $this->getLayout()->createBlock(
84  \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option::class,
85  'adminhtml.catalog.product.edit.tab.bundle.option'
86  )
87  );
88 
89  return parent::_prepareLayout();
90  }
__()
Definition: __.php:13
setData($key, $value=null)
Definition: DataObject.php:72

◆ canShowTab()

canShowTab ( )
Returns
bool

Implements TabInterface.

Definition at line 153 of file Bundle.php.

154  {
155  return true;
156  }

◆ getAddButtonHtml()

getAddButtonHtml ( )
Returns
string

Definition at line 105 of file Bundle.php.

106  {
107  return $this->getChildHtml('add_button');
108  }

◆ getFieldSuffix()

getFieldSuffix ( )
Returns
string

Definition at line 121 of file Bundle.php.

122  {
123  return 'product';
124  }

◆ getOptionsBoxHtml()

getOptionsBoxHtml ( )
Returns
string

Definition at line 113 of file Bundle.php.

114  {
115  return $this->getChildHtml('options_box');
116  }

◆ getParentTab()

getParentTab ( )

Get parent tab code

Returns
string

Definition at line 171 of file Bundle.php.

172  {
173  return 'product-details';
174  }

◆ getProduct()

getProduct ( )
Returns
mixed

Definition at line 129 of file Bundle.php.

130  {
131  return $this->_coreRegistry->registry('product');
132  }

◆ getTabClass()

getTabClass ( )
Returns
string

Definition at line 57 of file Bundle.php.

58  {
59  return 'ajax';
60  }

◆ getTabLabel()

getTabLabel ( )
Returns
\Magento\Framework\Phrase

Implements TabInterface.

Definition at line 137 of file Bundle.php.

138  {
139  return __('Bundle Items');
140  }
__()
Definition: __.php:13

◆ getTabTitle()

getTabTitle ( )
Returns
\Magento\Framework\Phrase

Implements TabInterface.

Definition at line 145 of file Bundle.php.

146  {
147  return __('Bundle Items');
148  }
__()
Definition: __.php:13

◆ getTabUrl()

getTabUrl ( )
Returns
string

Definition at line 49 of file Bundle.php.

50  {
51  return $this->getUrl('adminhtml/bundle_product_edit/form', ['_current' => true]);
52  }

◆ isHidden()

isHidden ( )
Returns
bool

Implements TabInterface.

Definition at line 161 of file Bundle.php.

162  {
163  return false;
164  }

◆ isReadonly()

isReadonly ( )

Check block readonly

Returns
boolean

Definition at line 97 of file Bundle.php.

98  {
99  return $this->getProduct()->getCompositeReadonly();
100  }

Field Documentation

◆ $_coreRegistry

$_coreRegistry = null
protected

Definition at line 30 of file Bundle.php.

◆ $_product

$_product = null
protected

Definition at line 18 of file Bundle.php.

◆ $_template

$_template = 'Magento_Bundle::product/edit/bundle.phtml'
protected

Definition at line 23 of file Bundle.php.


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