當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。