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


PHP DataObject::getCustomerId方法代码示例

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


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

示例1: render

 /**
  * Renders grid column
  *
  * @param \Magento\Framework\DataObject $row
  * @return \Magento\Framework\Phrase|string
  */
 public function render(\Magento\Framework\DataObject $row)
 {
     $id = $row->getCustomerId();
     if (!$id) {
         return __('Show Reviews');
     }
     return sprintf('<a href="%s">%s</a>', $this->getUrl('review/product/', ['customerId' => $id]), __('Show Reviews'));
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:14,代码来源:Customer.php

示例2: render

 /**
  * Render review type
  *
  * @param \Magento\Framework\DataObject $row
  * @return \Magento\Framework\Phrase
  */
 public function render(\Magento\Framework\DataObject $row)
 {
     if ($row->getCustomerId()) {
         return __('Customer');
     }
     if ($row->getStoreId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID) {
         return __('Administrator');
     }
     return __('Guest');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:Type.php

示例3: _afterDelete

 /**
  * {@inheritdoc}
  */
 protected function _afterDelete(\Magento\Framework\DataObject $address)
 {
     if ($address->getId()) {
         $customer = $this->customerRepository->getById($address->getCustomerId());
         if ($customer->getDefaultBilling() == $address->getId()) {
             $customer->setDefaultBilling(null);
         }
         if ($customer->getDefaultShipping() == $address->getId()) {
             $customer->setDefaultShipping(null);
         }
         $this->customerRepository->save($customer);
     }
     return parent::_afterDelete($address);
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:17,代码来源:Address.php

示例4: getRowUrl

 /**
  * @param \Magento\Framework\DataObject $row
  *
  * @return string
  */
 public function getRowUrl($row)
 {
     return $this->getUrl('customer/index/edit', ['id' => $row->getCustomerId(), 'active_tab' => 'cart']);
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:9,代码来源:Grid.php

示例5: registerIds

 /**
  * Add information about product ids to visitor/customer
  *
  * @param \Magento\Framework\DataObject|\Magento\Reports\Model\Product\Index\AbstractIndex $object
  * @param int[] $productIds
  * @return $this
  */
 public function registerIds(\Magento\Framework\DataObject $object, $productIds)
 {
     $row = ['visitor_id' => $object->getVisitorId(), 'customer_id' => $object->getCustomerId(), 'store_id' => $object->getStoreId()];
     $data = [];
     foreach ($productIds as $productId) {
         $productId = (int) $productId;
         if ($productId) {
             $row['product_id'] = $productId;
             $data[] = $row;
         }
     }
     $matchFields = ['product_id', 'store_id'];
     foreach ($data as $row) {
         $this->_resourceHelper->mergeVisitorProductIndex($this->getMainTable(), $row, $matchFields);
     }
     return $this;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:24,代码来源:AbstractIndex.php

示例6: registerIds

 /**
  * Add information about product ids to visitor/customer
  *
  * @param \Magento\Framework\DataObject|\Magento\Reports\Model\Product\Index\AbstractIndex $object
  * @param int[] $productIds
  * @return $this
  */
 public function registerIds(\Magento\Framework\DataObject $object, $productIds)
 {
     $row = ['visitor_id' => $object->getVisitorId(), 'customer_id' => $object->getCustomerId(), 'store_id' => $object->getStoreId()];
     $addedAt = (new \DateTime())->getTimestamp();
     $data = [];
     foreach ($productIds as $productId) {
         $productId = (int) $productId;
         if ($productId) {
             $row['product_id'] = $productId;
             $row['added_at'] = $this->dateTime->formatDate($addedAt);
             $data[] = $row;
         }
         $addedAt -= $addedAt > 0 ? 1 : 0;
     }
     $matchFields = ['product_id', 'store_id'];
     foreach ($data as $row) {
         $this->_resourceHelper->mergeVisitorProductIndex($this->getMainTable(), $row, $matchFields);
     }
     return $this;
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:27,代码来源:AbstractIndex.php


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