本文整理匯總了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();
}