本文整理匯總了PHP中oxBase::__get方法的典型用法代碼示例。如果您正苦於以下問題:PHP oxBase::__get方法的具體用法?PHP oxBase::__get怎麽用?PHP oxBase::__get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類oxBase
的用法示例。
在下文中一共展示了oxBase::__get方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __get
/**
* Special getter for oxpayments__oxdesc field
*
* @param string $sName name of field
*
* @return string
*/
public function __get($sName)
{
//due to compatibility with templates
if ($sName == 'oxpayments__oxdesc') {
if ($this->_oPayment === null) {
$this->_oPayment = oxNew('oxpayment');
$this->_oPayment->load($this->oxuserpayments__oxpaymentsid->value);
}
return $this->_oPayment->oxpayments__oxdesc;
}
if ($sName == 'aDynValues') {
if ($this->_aDynValues === null) {
$this->_aDynValues = $this->getDynValues();
}
return $this->_aDynValues;
}
return parent::__get($sName);
}
示例2: __get
/**
* Extra getter to guarantee compatibility with templates
*
* @param string $sName name of variable to get
*
* @return string
*/
public function __get($sName)
{
switch ($sName) {
// simple voucher mapping
case 'sVoucherId':
return $this->getId();
break;
case 'sVoucherNr':
return $this->oxvouchers__oxvouchernr;
break;
case 'fVoucherdiscount':
return $this->oxvouchers__oxdiscount;
break;
}
return parent::__get($sName);
}