本文整理汇总了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());
}
示例2: buildNodeName
/**
* Get Category Name
*
* @param \Magento\Framework\DataObject $node
* @return string
*/
public function buildNodeName($node)
{
$result = $this->escapeHtml($node->getName());
return $result;
}
示例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));
}
示例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');
}
示例5: getFileName
/**
* File name URL getter
*
* @param \Magento\Framework\DataObject $file
* @return string
*/
public function getFileName(\Magento\Framework\DataObject $file)
{
return $file->getName();
}
示例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;
}
示例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);
}
示例8: render
/**
* {@inheritdoc}
*/
public function render(DataObject $row)
{
return str_repeat(' ', $row->getLevel() * 10) . $row->getName();
}