本文整理汇总了PHP中XLite\Model\AEntity::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP AEntity::getId方法的具体用法?PHP AEntity::getId怎么用?PHP AEntity::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLite\Model\AEntity
的用法示例。
在下文中一共展示了AEntity::getId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildMetodName
/**
* Build metod name
*
* @param \XLite\Model\AEntity $entity Entity
* @param string $pattern Pattern
*
* @return string
*/
protected function buildMetodName(\XLite\Model\AEntity $entity, $pattern)
{
return static::TYPE_DISCOUNTS == $entity->getId() ? sprintf($pattern, 'Discounts') : parent::buildMetodName($entity, $pattern);
}
示例2: buildMetodName
/**
* Build metod name
*
* @param \XLite\Model\AEntity $entity Entity
* @param string $pattern Pattern
*
* @return string
*/
protected function buildMetodName(\XLite\Model\AEntity $entity, $pattern)
{
return static::TYPE_COUPONS == $entity->getId() ? sprintf($pattern, 'Coupons') : parent::buildMetodName($entity, $pattern);
}
示例3: isDefaultCard
/**
* Check - specified card is default or not
*
* @param \XLite\Model\AEntity $entity Model OPTIONAL
*
* @return boolean
*/
public function isDefaultCard(\XLite\Model\AEntity $entity = null)
{
return $entity && $entity->getId() == $this->getCustomerProfile()->getDefaultCardId();
}
示例4: isDefaultEntity
/**
* Is default entity
*
* @param \XLite\Model\AEntity $entity Line
*
* @return boolean
*/
protected function isDefaultEntity(\XLite\Model\AEntity $entity)
{
return isset($this->requestData['defaultValue']) && $this->requestData['defaultValue'] == $entity->getId();
}
示例5: buildMetodName
/**
* Build metod name
*
* @param \XLite\Model\AEntity $entity Entity
* @param string $pattern Pattern
*
* @return string
*/
protected function buildMetodName(\XLite\Model\AEntity $entity, $pattern)
{
switch ($entity->getId()) {
case static::TYPE_PRODUCTS:
$name = 'Products';
break;
case static::TYPE_CATEGORIES:
$name = 'Categories';
break;
case static::TYPE_ORDERS:
$name = 'Orders';
break;
case static::TYPE_CUSTOMERS:
$name = 'Customers';
break;
default:
}
return $name ? sprintf($pattern, $name) : null;
}
示例6: getEditLinkAttributes
/**
* Get edit link params string
*
* @param \XLite\Model\AEntity $entity Entity
* @param array $column Column data
*
* @return string
*/
protected function getEditLinkAttributes(\XLite\Model\AEntity $entity, array $column)
{
$params = array();
$params[] = 'data-id=' . $entity->getId();
if ($entity->getProductClass()) {
$params[] = 'data-class-id=' . $entity->getProductClass()->getId();
}
return parent::getEditLinkAttributes($entity, $column) . implode(' ', $params);
}