当前位置: 首页>>代码示例>>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;未经允许,请勿转载。