Source for file ipointbank_object.php
Documentation is available at ipointbank_object.php
* The iPointBank class provides basic transaction functions for the Sloodle iBank module.
* @copyright Copyright (c) 2008 Sloodle (various contributors)
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3
* @contributor Paul G. Preibisch - aka Fire Centaur
* @method makeTransaction
* makeTransaction inserts a record into the sloodle_ipoint_trans table
* @returns returns true if insert was successful
* @returns returns false if insert was unsuccessful
* @$iTransaction is a dataObject (stdClass object) with appropriate fields matching the table structure
if (insert_record('sloodle_ipoint_trans',$iTransaction)) return true;
* @method getTransactionRecords
* getTransactionRecords returns the recordset of sloodle_ipoint_trans record
* for the $userId specified. if $userId is null, returns all the transaction records for this stipend
* @return returns transaction records for this user / or for all users
* @return If $userId is null, then all transactions are returned
* @staticvar $userId moodle id of the user
return get_records('sloodle_ipoint_trans','sloodleid',$this->getSloodleId());
$sql =
'SELECT * FROM '.
$CFG->prefix.
'sloodle_ipoint_trans'.
' WHERE userid='.
$userId.
' AND sloodleid='.
$this->getSloodleId().
' ORDER BY timemodified DESC';
$transRecs =
get_records_sql($sql);
* @method removeTransaction
* removeTransaction removes the transaction for this stipend
* @return true if successful
* @return false if unsuccessful
* @staticvar $userId moodle id of the user
* @staticvar $iType type of the transaction "stipend","credit","debit"
if (delete_records("sloodle_ipoint_trans",'sloodleid',$this->sloodleid,'itype',$iType,'userid',$userId))
if (!update_record("sloodle_ipoint_trans",$transactionUpdate))
error(get_string("stipendgiver:cantupdate","sloodle"));
* getAvatarDebits function
* @desc This function will search through all the transactions
* for this stipend based on avatar uuid and return the TOTAL debits amount
* @staticvar integer $debitAmount will be zero if no debits exist for this user and stipend
* @param string $avuuid the avatar UUID to search for
* @link http://sloodle.googlecode.com
//transactionRecords fields are:
//avuuid,userid,avname,amount,type,timemodified
if ($t->avuuid ==
$avuuid)
* @desc This function will search through all the transactions
* and return TOTAL debits for this course user
* @staticvar integer $debitAmount will be zero if no debits exist for this user and stipend
* @param string $avuuid the avatar UUID to search for
* @link http://sloodle.googlecode.com
//transactionRecords fields are:
//avuuid,userid,avname,amount,type,timemodified
foreach ($transRecs as $t)
Documentation generated on Fri, 17 Jul 2009 11:01:28 +0100 by phpDocumentor 1.4.0