Ejemplo n.º 1
0
 public static function I($arg_pdo)
 {
     if (is_null(self::$instance)) {
         self::$instance = new self();
     }
     self::$pdo = $arg_pdo;
     return self::$instance;
 }
Ejemplo n.º 2
0
<?php

$rootPass = dirname(__FILE__) . '/../../';
// $rootPass = dirname(__FILE__). '/../';
require_once $rootPass . 'lib/db/dbfunctions.php';
require_once $rootPass . 'lib/db/dbFacade.php';
$pdo = getPDO($argv[1]);
// $pdo = getPDO('test');
$dbfacade = DBFacade::I($pdo);
header("Content-Type: application/json; charset=utf-8");
echo json_encode($dbfacade->getAllLog());
Ejemplo n.º 3
0
 public function testfindLOCAByUserID()
 {
     $pmapper = new PaymentMapper(self::$pdo);
     $dmapper = new DepositMapper(self::$pdo);
     $dbfacade = DBFacade::I(self::$pdo);
     $payment = getPaymentInstance();
     $deposit = getDepositInstance();
     $pmapper->insert($payment);
     $dmapper->insert($deposit);
     $result = $dbfacade->findLOCALogByUserID(1);
     // instanceは二つともuser_id=1になっているため
     $this->assertEquals(2, count($result));
 }