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


PHP Object::getTypeId方法代码示例

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


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

示例1: render

 /**
  * Render minimal price for downloadable products
  *
  * @param \Magento\Framework\Object $row
  * @return string
  */
 public function render(\Magento\Framework\Object $row)
 {
     if ($row->getTypeId() == 'downloadable') {
         $row->setPrice($row->getPrice());
     }
     return parent::render($row);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:13,代码来源:Price.php

示例2: beforeSave

 /**
  * We need reset attribute set id to attribute after related simple product was saved
  *
  * @param \Magento\Catalog\Model\Resource\Product $subject
  * @param \Magento\Framework\Object $object
  * @return void
  *
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function beforeSave(\Magento\Catalog\Model\Resource\Product $subject, \Magento\Framework\Object $object)
 {
     /** @var \Magento\Catalog\Model\Product $object */
     if ($object->getTypeId() == Configurable::TYPE_CODE) {
         $object->getTypeInstance()->getSetAttributes($object);
     }
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:16,代码来源:Product.php

示例3: aroundValidate

 /**
  * @param \Magento\Catalog\Model\Product\Attribute\Backend\Price $subject
  * @param \Closure $proceed
  * @param \Magento\Catalog\Model\Product|\Magento\Framework\Object $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:shabbirvividads,项目名称:magento2,代码行数:15,代码来源:PriceBackend.php

示例4: getAttributeRow

 /**
  * Return attribute row to prepare where statement
  *
  * @param \Magento\Framework\Object $entity
  * @param \Magento\Framework\Object $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:opexsw,项目名称:magento2,代码行数:16,代码来源:AbstractEntity.php

示例5: _isApplicableAttribute

 /**
  * Check whether the attribute is Applicable to the object
  *
  * @param \Magento\Framework\Object $object
  * @param \Magento\Catalog\Model\Resource\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:aiesh,项目名称:magento2,代码行数:12,代码来源:AbstractResource.php

示例6: _isInactive

 /**
  * Returns whether this qty field must be inactive
  *
  * @param \Magento\Framework\Object $row
  * @return bool
  */
 protected function _isInactive($row)
 {
     return $this->typeConfig->isProductSet($row->getTypeId());
 }
开发者ID:aiesh,项目名称:magento2,代码行数:10,代码来源:Qty.php


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