當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataObject::getName方法代碼示例

本文整理匯總了PHP中Magento\Framework\DataObject::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataObject::getName方法的具體用法?PHP DataObject::getName怎麽用?PHP DataObject::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\DataObject的用法示例。


在下文中一共展示了DataObject::getName方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testGetAllItems

 public function testGetAllItems()
 {
     $totals = $this->_prepareValidModelData();
     $this->assertEquals([new \Magento\Framework\DataObject(['name' => $this->_validItem->getName(), 'qty' => $this->_validItem->getQty(), 'amount' => $this->_validItem->getPrice()])], $this->_model->getAllItems());
     $this->assertEquals($totals['subtotal'], $this->_model->getSubtotal());
     $this->assertEquals($totals['tax'], $this->_model->getTax());
     $this->assertEquals($totals['shipping'], $this->_model->getShipping());
     $this->assertEquals($totals['discount'], $this->_model->getDiscount());
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:9,代碼來源:CartTest.php

示例2: buildNodeName

 /**
  * Get Category Name
  *
  * @param \Magento\Framework\DataObject $node
  * @return string
  */
 public function buildNodeName($node)
 {
     $result = $this->escapeHtml($node->getName());
     return $result;
 }
開發者ID:mageplaza,項目名稱:magento-2-blog-extension,代碼行數:11,代碼來源:Tree.php

示例3: setShipperDetails

 /**
  * Set shipper details into request
  * @param \Magento\Shipping\Model\Shipment\Request $request
  * @param \Magento\User\Model\User $storeAdmin
  * @param \Magento\Framework\DataObject $store
  * @param $shipmentStoreId
  * @param $regionCode
  * @param $originStreet
  * @return void
  */
 protected function setShipperDetails(Request $request, User $storeAdmin, DataObject $store, $shipmentStoreId, $regionCode, $originStreet)
 {
     $originStreet2 = $this->_scopeConfig->getValue(Shipment::XML_PATH_STORE_ADDRESS2, ScopeInterface::SCOPE_STORE, $shipmentStoreId);
     $request->setShipperContactPersonName($storeAdmin->getName());
     $request->setShipperContactPersonFirstName($storeAdmin->getFirstname());
     $request->setShipperContactPersonLastName($storeAdmin->getLastname());
     $request->setShipperContactCompanyName($store->getName());
     $request->setShipperContactPhoneNumber($store->getPhone());
     $request->setShipperEmail($storeAdmin->getEmail());
     $request->setShipperAddressStreet(trim($originStreet . ' ' . $originStreet2));
     $request->setShipperAddressStreet1($originStreet);
     $request->setShipperAddressStreet2($originStreet2);
     $request->setShipperAddressCity($this->_scopeConfig->getValue(Shipment::XML_PATH_STORE_CITY, ScopeInterface::SCOPE_STORE, $shipmentStoreId));
     $request->setShipperAddressStateOrProvinceCode($regionCode);
     $request->setShipperAddressPostalCode($this->_scopeConfig->getValue(Shipment::XML_PATH_STORE_ZIP, ScopeInterface::SCOPE_STORE, $shipmentStoreId));
     $request->setShipperAddressCountryCode($this->_scopeConfig->getValue(Shipment::XML_PATH_STORE_COUNTRY_ID, ScopeInterface::SCOPE_STORE, $shipmentStoreId));
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:27,代碼來源:Labels.php

示例4: getSearchUrl

 /**
  * @param \Magento\Framework\DataObject $obj
  * @return string
  */
 public function getSearchUrl($obj)
 {
     /** @var $url UrlInterface */
     $url = $this->_urlFactory->create();
     /*
      * url encoding will be done in Url.php http_build_query
      * so no need to explicitly called urlencode for the text
      */
     $url->setQueryParam('q', $obj->getName());
     return $url->getUrl('catalogsearch/result');
 }
開發者ID:tingyeeh,項目名稱:magento2,代碼行數:15,代碼來源:Term.php

示例5: getFileName

 /**
  * File name URL getter
  *
  * @param  \Magento\Framework\DataObject $file
  * @return string
  */
 public function getFileName(\Magento\Framework\DataObject $file)
 {
     return $file->getName();
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:10,代碼來源:Files.php

示例6: buildNodeName

 /**
  * Get category name
  *
  * @param \Magento\Framework\DataObject $node
  * @return string
  */
 public function buildNodeName($node)
 {
     $result = $this->escapeHtml($node->getName());
     if ($this->_withProductCount) {
         $result .= ' (' . $node->getProductCount() . ')';
     }
     return $result;
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:14,代碼來源:Tree.php

示例7: _beforeSave

 /**
  * {@inheritdoc}
  */
 protected function _beforeSave(DataObject $post)
 {
     /** @var \Mirasvit\Blog\Model\Post $post */
     if (!$post->hasData('type')) {
         $post->setData('type', \Mirasvit\Blog\Model\Post::TYPE_POST);
     }
     if (!$post->getData('url_key')) {
         $post->setData('url_key', $this->filter->translitUrl($post->getName()));
     }
     $this->saveImage($post);
     return parent::_beforeSave($post);
 }
開發者ID:mirasvit,項目名稱:module-blog,代碼行數:15,代碼來源:Post.php

示例8: render

 /**
  * {@inheritdoc}
  */
 public function render(DataObject $row)
 {
     return str_repeat(' ', $row->getLevel() * 10) . $row->getName();
 }
開發者ID:mirasvit,項目名稱:module-blog,代碼行數:7,代碼來源:Title.php


注:本文中的Magento\Framework\DataObject::getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。