/** * Returns user payment history list object * * @param string $sOXID object ID (default is null) * * @return object oxlist with oxuserpayments objects */ public function getUserPayments($sOXID = null) { if ($this->_oPayments === null) { if (!$sOXID) { $sOXID = $this->getId(); } $sSelect = 'select * from oxuserpayments where oxuserid = ' . oxDb::getDb()->quote($sOXID) . ' '; $this->_oPayments = oxNew('oxlist'); $this->_oPayments->init('oxUserPayment'); $this->_oPayments->selectString($sSelect); $myUtils = oxUtils::getInstance(); foreach ($this->_oPayments as $oPayment) { // add custom fields to this class $oPayment = $myUtils->assignValuesFromText($val->oxuserpayments__oxvalue->value); } } return $this->_oPayments; }
public function testSelectStringIfLimitIsSet() { $oAction = oxNew("oxBase"); $oAction->init('oxactions'); $oAction->setId('_test1'); $oAction->oxactions__oxtitle = new oxField('action1', oxField::T_RAW); $oAction->save(); $oAction = oxNew("oxBase"); $oAction->init('oxactions'); $oAction->setId('_test2'); $oAction->oxactions__oxtitle = new oxField('action2', oxField::T_RAW); $oAction->save(); $oList = new oxlist('oxactions'); $oList->setSqlLimit(1, 1); $oList->selectString('select * from oxactions where oxid like "\\_%"'); $this->assertEquals('1', count($oList)); }