1
0

Cleanup, added docs & RC 2

This commit is contained in:
2017-04-04 08:26:11 +02:00
parent 21e67b0298
commit 3ee95398c4
18 changed files with 145 additions and 63 deletions

View File

@ -21,13 +21,16 @@ class Rekeningen
public static $BETAALREKENING = 1;
public static $SPAARREKENING = 2;
/**
* Return the current user bank accounts
* @return array
*/
public static function getCurrentUserRekeningen()
{
$container = Application::getContainer();
$user = $container->auth->getUserID();
$db = $container->db;
$ibanhelper = new IBAN;
$rekeningen = $db->rekeningen->where('klantid', $user);
@ -37,7 +40,7 @@ class Rekeningen
$type = $db->types->where('id', $rekening['typeid'])[$rekening['typeid']];
$returnArray[] = array(
"iban" => $ibanhelper->getIBAN($rekening['rekeningnr']),
"iban" => IBAN::getIBAN($rekening['rekeningnr']),
"nr" => $rekening['rekeningnr'],
"saldo" => (double) $rekening['saldo'],
"naam" => $type['rekeningnaam'],
@ -48,6 +51,11 @@ class Rekeningen
return $returnArray;
}
/**
* Check if the current user is the owner of this bank account
* @param string $iban
* @return boolean
*/
public static function isEigenRekeningIBAN($iban)
{
$rekeningen = Rekeningen::getCurrentUserRekeningen();
@ -62,6 +70,11 @@ class Rekeningen
return $vanRekening;
}
/**
* Check if the current user is the owner of this bank account
* @param string $nr Internal bank account number
* @return boolean
*/
public static function isEigenRekeningnr($nr)
{
$rekeningen = Rekeningen::getCurrentUserRekeningen();