本文整理汇总了PHP中XLite\Model\AEntity::getEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP AEntity::getEnabled方法的具体用法?PHP AEntity::getEnabled怎么用?PHP AEntity::getEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLite\Model\AEntity
的用法示例。
在下文中一共展示了AEntity::getEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: performDelete
/**
* Delete single entity
*
* @param \XLite\Model\AEntity $entity Entity to detach
*
* @return void
*/
protected function performDelete(\XLite\Model\AEntity $entity)
{
// Update quick flags
if ($entity->getParent()) {
$this->updateQuickFlags($entity->getParent(), $this->prepareQuickFlags(-1, $entity->getEnabled() ? -1 : 0));
}
// Root category cannot be removed. Only its subtree
$onlySubtree = $entity->getCategoryId() == $this->getRootCategoryId();
// Calculate some variables
$right = $entity->getRpos() - ($onlySubtree ? 1 : 0);
$width = $entity->getRpos() - $entity->getLpos() - ($onlySubtree ? 1 : -1);
// Update indexes in the nested set.
// FIXME: must not use execute()
$this->defineUpdateIndexQuery('lpos', $right, -$width)->execute();
$this->defineUpdateIndexQuery('rpos', $right, -$width)->execute();
if ($onlySubtree) {
$this->deleteInBatch($this->getSubtree($entity->getCategoryId()), false);
} else {
parent::performDelete($entity);
}
}
示例2: getMethodStatusTitle
/**
* Get hint text for entity status
*
* @param \XLite\Model\AEntity $entity Line model
*
* @return string
*/
protected function getMethodStatusTitle(\XLite\Model\AEntity $entity)
{
return $entity->getEnabled() ? static::t('Payment method is enabled') : static::t('Payment method is disabled');
}