public function __construct($phid, TransactionList $transactions, ProjectColumnRepository $columns, array $closedColumnNames) { $this->phid = $phid; $this->transactions = $transactions->getChronologicallySorted(); $this->taskColumnPHIDs = $this->extractColumnIDs($this->transactions); $this->columns = $columns; $this->closedColumnNames = $closedColumnNames; }
public function testTransactionListValuesAreProperlySet() { $transactionList = json_decode(file_get_contents(__DIR__ . '/data/example-response.json')); $transactionList = TransactionList::create($transactionList->accountStatement); $this->assertSame(500, $transactionList->getOpeningBalance()); $this->assertSame(1000, $transactionList->getClosingBalance()); $this->assertEquals(new \DateTime('2015-03-30+0200'), $transactionList->getDateStart()); $this->assertEquals(new \DateTime('2015-03-31+0200'), $transactionList->getDateEnd()); $this->assertSame(1111111111, $transactionList->getIdFrom()); $this->assertSame(1111111999, $transactionList->getIdTo()); $this->assertSame(null, $transactionList->getIdLastDownload()); $this->assertInstanceOf('FioApi\\Account', $transactionList->getAccount()); $this->assertInstanceOf('FioApi\\Transaction', $transactionList->getTransactions()[0]); }
$result = mysqli_query($this->connection, $query); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $temp_array[] = $row; } header('Content-Type: application/json'); echo json_encode(array("transactions" => $temp_array)); mysqli_close($this->connection); } else { $json['error'] = ' wrong username or password'; echo json_encode($json); mysqli_close($this->connection); } } } $transactionList = new TransactionList(); if (isset($_POST['userid']) && isset($_POST['numOfTransactions'])) { $userid = $_POST['userid']; $numOfTransactions = $_POST['numOfTransactions']; if (!empty($userid)) { $transactionList->getLastXTransactions($userid, $numOfTransactions); } } else { if (isset($_POST['userid'])) { $userid = $_POST['userid']; //$password = $_POST['password']; if (!empty($userid)) { //$encrypted_password = md5($password); $transactionList->getLastTenTransactions($userid); } } else {