当前位置: 首页>>代码示例>>PHP>>正文


PHP DataObject::getId方法代码示例

本文整理汇总了PHP中Magento\Framework\DataObject::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP DataObject::getId方法的具体用法?PHP DataObject::getId怎么用?PHP DataObject::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Framework\DataObject的用法示例。


在下文中一共展示了DataObject::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 /**
  * Renders grid column
  *
  * @param   \Magento\Framework\DataObject $row
  * @return  string
  */
 public function render(\Magento\Framework\DataObject $row)
 {
     $readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' . __('Read Details') . '</a>' : '';
     $markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl('*/*/markAsRead/', ['_current' => true, 'id' => $row->getId()]) . '">' . __('Mark as Read') . '</a>' : '';
     $encodedUrl = $this->_urlHelper->getEncodedUrl();
     return sprintf('%s%s<a class="action-delete" href="%s" onClick="deleteConfirm(\'%s\', this.href); return false;">%s</a>', $readDetailsHtml, $markAsReadHtml, $this->getUrl('*/*/remove/', ['_current' => true, 'id' => $row->getId(), \Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl]), __('Are you sure?'), __('Remove'));
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:Actions.php

示例2: render

 /**
  * Renderer for "Action" column in Newsletter templates grid
  *
  * @param \Magento\Framework\DataObject $row
  * @return string
  */
 public function render(\Magento\Framework\DataObject $row)
 {
     if ($row->isValidForSend()) {
         $actions[] = ['url' => $this->getUrl('*/queue/edit', ['template_id' => $row->getId()]), 'caption' => __('Queue Newsletter')];
     }
     $actions[] = ['url' => $this->getUrl('*/*/preview', ['id' => $row->getId()]), 'popup' => true, 'caption' => __('Preview')];
     $this->getColumn()->setActions($actions);
     return parent::render($row);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:15,代码来源:Action.php

示例3: render

 /**
  * @param \Magento\Framework\DataObject $row
  * @return string
  */
 public function render(\Magento\Framework\DataObject $row)
 {
     $this->_actions = [];
     if ($this->_salesReorder->canReorder($row->getId())) {
         $reorderAction = ['@' => ['href' => $this->getUrl('sales/order_create/reorder', ['order_id' => $row->getId()])], '#' => __('Reorder')];
         $this->addToActions($reorderAction);
     }
     $this->_eventManager->dispatch('adminhtml_customer_orders_add_action_renderer', ['renderer' => $this, 'row' => $row]);
     return $this->_actionsToHtml();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:Action.php

示例4: render

 /**
  * Renders grid column
  *
  * @param   \Magento\Framework\DataObject $row
  * @return  string
  */
 public function render(\Magento\Framework\DataObject $row)
 {
     $encodedUrl = $this->_urlHelper->getEncodedUrl();
     if (!$row->getIsRead()) {
         return sprintf('<a href="%s">%s</a> | <a href="%s" onClick="deleteConfirm(\'%s\',this.href); return false;">%s</a>', $this->getUrl('*/*/markAsRead/', ['_current' => true, 'id' => $row->getId()]), __('Mark as Read'), $this->getUrl('*/*/remove/', ['_current' => true, 'id' => $row->getId(), \Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl]), __('Are you sure?'), __('Remove'));
     } else {
         return sprintf('<a href="%s" onClick="deleteConfirm(\'%s\',this.href); return false;">%s</a>', $this->getUrl('*/*/remove/', ['_current' => true, 'id' => $row->getId(), \Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl]), __('Are you sure?'), __('Remove'));
     }
     return parent::render($row);
 }
开发者ID:shipperhq,项目名称:module-logger,代码行数:16,代码来源:Actions.php

示例5: render

 public function render(DataObject $row)
 {
     $storeViewId = $this->getRequest()->getParam('store');
     $banner = $this->_bannerFactory->create()->setStoreViewId($storeViewId)->load($row->getId());
     $srcImage = $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) . $banner->getImage();
     return '<image width="150" height="50" src ="' . $srcImage . '" alt="' . $banner->getImage() . '" >';
 }
开发者ID:mrtuvn,项目名称:m2ce.dev,代码行数:7,代码来源:Image.php

示例6: beforeSave

 /**
  * Set new increment id
  *
  * @param \Magento\Framework\DataObject $object
  * @return $this
  */
 public function beforeSave($object)
 {
     if (!$object->getId()) {
         $this->getAttribute()->getEntity()->setNewIncrementId($object);
     }
     return $this;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:13,代码来源:Increment.php

示例7: _getParentTransactionId

 /**
  * Get payflow transaction id from parent transaction
  *
  * @param \Magento\Framework\DataObject $payment
  * @return string
  */
 protected function _getParentTransactionId(\Magento\Framework\DataObject $payment)
 {
     if ($payment->getParentTransactionId()) {
         return $this->transactionRepository->getByTransactionId($payment->getParentTransactionId(), $payment->getId(), $payment->getOrder()->getId())->getAdditionalInformation(self::TRANSPORT_PAYFLOW_TXN_ID);
     }
     return $payment->getParentTransactionId();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:Pro.php

示例8: render

 /**
  * Render grid column
  *
  * @param \Magento\Framework\DataObject $row
  * @return string
  */
 public function render(\Magento\Framework\DataObject $row)
 {
     $actions = [];
     $actions[] = ['url' => $this->getUrl('adminhtml/*/preview', ['id' => $row->getId()]), 'popup' => true, 'caption' => __('Preview')];
     $this->getColumn()->setActions($actions);
     return parent::render($row);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:Action.php

示例9: render

 /**
  * Renders grid column
  *
  * @param   \Magento\Framework\DataObject $row
  * @return  string
  */
 public function render(\Magento\Framework\DataObject $row)
 {
     if ($row->getSubscriberStatus() == \Magento\Newsletter\Model\Subscriber::STATUS_SUBSCRIBED) {
         return '<input type="checkbox" name="subscriber[]" value="' . $row->getId() . '" class="subscriberCheckbox"/>';
     } else {
         return '';
     }
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:Checkbox.php

示例10: render

 /**
  * Renders column
  *
  * @param \Magento\Framework\DataObject $row
  * @return string
  */
 public function render(\Magento\Framework\DataObject $row)
 {
     $actions = [];
     if ($row->getQueueStatus() == \Magento\Newsletter\Model\Queue::STATUS_NEVER) {
         if (!$row->getQueueStartAt() && $row->getSubscribersTotal()) {
             $actions[] = ['url' => $this->getUrl('*/*/start', ['id' => $row->getId()]), 'caption' => __('Start')];
         }
     } elseif ($row->getQueueStatus() == \Magento\Newsletter\Model\Queue::STATUS_SENDING) {
         $actions[] = ['url' => $this->getUrl('*/*/pause', ['id' => $row->getId()]), 'caption' => __('Pause')];
         $actions[] = ['url' => $this->getUrl('*/*/cancel', ['id' => $row->getId()]), 'confirm' => __('Do you really want to cancel the queue?'), 'caption' => __('Cancel')];
     } elseif ($row->getQueueStatus() == \Magento\Newsletter\Model\Queue::STATUS_PAUSE) {
         $actions[] = ['url' => $this->getUrl('*/*/resume', ['id' => $row->getId()]), 'caption' => __('Resume')];
     }
     $actions[] = ['url' => $this->getUrl('*/*/preview', ['id' => $row->getId()]), 'caption' => __('Preview'), 'popup' => true];
     $this->getColumn()->setActions($actions);
     return parent::render($row);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:23,代码来源:Action.php

示例11: render

 public function render(\Magento\Framework\DataObject $row)
 {
     $ticket = $this->ticketFactory->create()->load($row->getId());
     if ($ticket && $ticket->getId()) {
         return $ticket->getSeverityAsLabel();
     }
     return '';
 }
开发者ID:ksz2013,项目名称:B05032-Foggyline_Helpdesk,代码行数:8,代码来源:Severity.php

示例12: beforeSave

 /**
  * Before save
  *
  * @param \Magento\Framework\DataObject $object
  * @return $this
  */
 public function beforeSave($object)
 {
     if ($object->getId()) {
         return $this;
     }
     if (!$object->hasData('website_id')) {
         $object->setData('website_id', $this->_storeManager->getStore()->getWebsiteId());
     }
     return $this;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:Website.php

示例13: beforeSave

 /**
  * Before save
  *
  * @param \Magento\Framework\DataObject $object
  * @return $this
  */
 public function beforeSave($object)
 {
     if ($object->getId()) {
         return $this;
     }
     if (!$object->hasStoreId()) {
         $object->setStoreId($this->_storeManager->getStore()->getId());
     }
     if (!$object->hasData('created_in')) {
         $object->setData('created_in', $this->_storeManager->getStore($object->getStoreId())->getName());
     }
     return $this;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:19,代码来源:Store.php

示例14: render

 /**
  * Renders grid column
  *
  * @param   \Magento\Framework\DataObject $row
  * @return  string
  */
 public function render(\Magento\Framework\DataObject $row)
 {
     $values = $this->_getValues();
     $value = $row->getData($this->getColumn()->getIndex());
     if (is_array($values)) {
         $checked = in_array($value, $values) ? ' checked="checked"' : '';
     } else {
         $checked = $value === $this->getColumn()->getValue() ? ' checked="checked"' : '';
     }
     $html = '<input type="radio" name="' . $this->getColumn()->getHtmlName() . '" ';
     $html .= 'value="' . $row->getId() . '" class="radio"' . $checked . '/>';
     return $html;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:19,代码来源:Radio.php

示例15: prepare

 /**
  * Set qty and custom price for quote item
  *
  * @param Item $item
  * @param \Magento\Framework\DataObject $request
  * @param Product $candidate
  * @return void
  */
 public function prepare(Item $item, DataObject $request, Product $candidate)
 {
     /**
      * We specify qty after we know about parent (for stock)
      */
     if ($request->getResetCount() && !$candidate->getStickWithinParent() && $item->getId() == $request->getId()) {
         $item->setData(CartItemInterface::KEY_QTY, 0);
     }
     $item->addQty($candidate->getCartQty());
     $customPrice = $request->getCustomPrice();
     if (!empty($customPrice)) {
         $item->setCustomPrice($customPrice);
         $item->setOriginalCustomPrice($customPrice);
     }
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:23,代码来源:Processor.php


注:本文中的Magento\Framework\DataObject::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。