本文整理汇总了PHP中XLite\Model\AEntity::getProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP AEntity::getProduct方法的具体用法?PHP AEntity::getProduct怎么用?PHP AEntity::getProduct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLite\Model\AEntity
的用法示例。
在下文中一共展示了AEntity::getProduct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modifyMoney
/**
* Modify money
*
* @param float $value Value
* @param \XLite\Model\AEntity $model Model
* @param string $property Model's property
* @param array $behaviors Behaviors
* @param string $purpose Purpose
*
* @return void
*/
public static function modifyMoney($value, \XLite\Model\AEntity $model, $property, array $behaviors, $purpose)
{
$obj = $model instanceof \XLite\Model\Product ? $model : $model->getProduct();
return \XLite\Module\CDev\VAT\Logic\Product\Tax::getInstance()->deductTaxFromPrice($obj, $value);
}
示例2: removeEntity
/**
* Remove entity
*
* @param \XLite\Model\AEntity $entity Entity
*
* @return boolean
*/
protected function removeEntity(\XLite\Model\AEntity $entity)
{
$product = $entity->getProduct();
if ($this->isNeedUpdateStock() && !$entity->isDeleted()) {
// Return items to stock
$entity->changeAmount($entity->getAmount());
}
$attributes = $this->getAttributeValuesAsString($entity);
\XLite\Controller\Admin\Order::setOrderChanges('Removed items:' . $entity->getItemId(), sprintf('[%s] %s (%s x %d%s)', $product->getSku(), $product->getName(), static::formatPrice($entity->getPrice(), $entity->getOrder()->getCurrency(), true), $entity->getAmount(), $attributes ? ', ' . $attributes : ''));
return parent::removeEntity($entity);
}
示例3: buildEntityURL
/**
* Build entity page URL
*
* @param \XLite\Model\AEntity $entity Entity
* @param array $column Column data
*
* @return string
*/
protected function buildEntityURL(\XLite\Model\AEntity $entity, array $column)
{
if ('product' == $column[static::COLUMN_CODE]) {
$result = \XLite\Core\Converter::buildURL('product', '', array('product_id' => $entity->getProduct()->getProductId()));
} else {
$result = parent::buildEntityURL($entity, $column);
}
return $result;
}
示例4: getAttributeValues
/**
* Return attribute values
*
* @param \XLite\Model\AEntity $model Model
*
* @return array
*/
protected static function getAttributeValues(\XLite\Model\AEntity $model)
{
return $model instanceof \XLite\Module\XC\ProductVariants\Model\ProductVariant ? $model->getProduct()->getAttrValues() : parent::getAttributeValues($model);
}
示例5: getObject
/**
* Modify money
*
* @param \XLite\Model\AEntity $model Model
*
* @return \XLite\Model\AEntity
*/
protected static function getObject(\XLite\Model\AEntity $model)
{
return $model instanceof \XLite\Model\Product ? $model : $model->getProduct();
}