Added static object linking & authorization methods
This commit is contained in:
42
src/Application/Helper/Rekeningen.php
Normal file
42
src/Application/Helper/Rekeningen.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Informatica Eindproject D4p
|
||||
* 6in3, Stedelijk Gymnasium Nijmegen
|
||||
* Docent: Hans de Wolf
|
||||
*
|
||||
* ==================
|
||||
*
|
||||
* Daniel Boutros,
|
||||
* Christiaan Goossens,
|
||||
* Jelmer Hinssen
|
||||
*/
|
||||
|
||||
namespace Inforbank\Application\Helper;
|
||||
|
||||
use Inforbank\Application;
|
||||
|
||||
class Rekeningen
|
||||
{
|
||||
public function getCurrentUserRekeningen()
|
||||
{
|
||||
$container = Application::getContainer();
|
||||
$user = $container->auth->getUser();
|
||||
|
||||
$db = $container->db;
|
||||
$ibanhelper = new IBAN;
|
||||
|
||||
$rekeningen = $db->rekeningen->where('klantid', $user['id']);
|
||||
|
||||
$returnArray = array();
|
||||
|
||||
foreach ($rekeningen as $rekening) {
|
||||
$returnArray[] = array(
|
||||
"rekeningnr" => $ibanhelper->getIBAN($rekening['rekeningnr']),
|
||||
"saldo" => (double) $rekening['saldo']
|
||||
);
|
||||
}
|
||||
|
||||
return $returnArray;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user