當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataObject::getTypeId方法代碼示例

本文整理匯總了PHP中Magento\Framework\DataObject::getTypeId方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataObject::getTypeId方法的具體用法?PHP DataObject::getTypeId怎麽用?PHP DataObject::getTypeId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\DataObject的用法示例。


在下文中一共展示了DataObject::getTypeId方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 /**
  * Render minimal price for downloadable products
  *
  * @param \Magento\Framework\DataObject $row
  * @return string
  */
 public function render(\Magento\Framework\DataObject $row)
 {
     if ($row->getTypeId() == 'downloadable') {
         $row->setPrice($row->getPrice());
     }
     return parent::render($row);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:13,代碼來源:Price.php

示例2: beforeSave

 /**
  * We need reset attribute set id to attribute after related simple product was saved
  *
  * @param \Magento\Catalog\Model\ResourceModel\Product $subject
  * @param \Magento\Framework\DataObject $object
  * @return void
  *
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function beforeSave(\Magento\Catalog\Model\ResourceModel\Product $subject, \Magento\Framework\DataObject $object)
 {
     /** @var \Magento\Catalog\Model\Product $object */
     if ($object->getTypeId() == Configurable::TYPE_CODE) {
         $object->getTypeInstance()->getSetAttributes($object);
     }
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:16,代碼來源:Product.php

示例3: aroundValidate

 /**
  * @param \Magento\Catalog\Model\Product\Attribute\Backend\Price $subject
  * @param \Closure $proceed
  * @param \Magento\Catalog\Model\Product|\Magento\Framework\DataObject $object
  * @return bool
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function aroundValidate(\Magento\Catalog\Model\Product\Attribute\Backend\Price $subject, \Closure $proceed, $object)
 {
     if ($object instanceof \Magento\Catalog\Model\Product && $object->getTypeId() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE && $object->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_DYNAMIC) {
         return true;
     } else {
         return $proceed($object);
     }
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:15,代碼來源:PriceBackend.php

示例4: aroundValidate

 /**
  * @param \Magento\Catalog\Model\Product\Attribute\Backend\Price $subject
  * @param \Closure $proceed
  * @param \Magento\Catalog\Model\Product|\Magento\Framework\DataObject $object
  * @return bool
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function aroundValidate(\Magento\Catalog\Model\Product\Attribute\Backend\Price $subject, \Closure $proceed, $object)
 {
     if ($object instanceof \Magento\Catalog\Model\Product && $object->getTypeId() == Configurable::TYPE_CODE) {
         return true;
     } else {
         return $proceed($object);
     }
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:15,代碼來源:PriceBackend.php

示例5: _isApplicableAttribute

 /**
  * Check whether the attribute is Applicable to the object
  *
  * @param \Magento\Framework\DataObject $object
  * @param \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute
  * @return boolean
  */
 protected function _isApplicableAttribute($object, $attribute)
 {
     $applyTo = $attribute->getApplyTo();
     return (count($applyTo) == 0 || in_array($object->getTypeId(), $applyTo)) && $attribute->isInSet($object->getAttributeSetId());
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:12,代碼來源:AbstractResource.php

示例6: getAttributeRow

 /**
  * Return attribute row to prepare where statement
  *
  * @param \Magento\Framework\DataObject $entity
  * @param \Magento\Framework\DataObject $object
  * @param \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute
  * @return array
  */
 protected function getAttributeRow($entity, $object, $attribute)
 {
     $data = ['attribute_id' => $attribute->getId(), $entity->getEntityIdField() => $object->getData($entity->getEntityIdField())];
     if (!$this->getEntityTable()) {
         $data['entity_type_id'] = $entity->getTypeId();
     }
     return $data;
 }
開發者ID:koliaGI,項目名稱:magento2,代碼行數:16,代碼來源:AbstractEntity.php

示例7: _isInactive

 /**
  * Returns whether this qty field must be inactive
  *
  * @param \Magento\Framework\DataObject $row
  * @return bool
  */
 protected function _isInactive($row)
 {
     return $this->typeConfig->isProductSet($row->getTypeId());
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:10,代碼來源:Qty.php


注:本文中的Magento\Framework\DataObject::getTypeId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。