예제 #1
0
파일: example.php 프로젝트: bmdevel/bav
    } else {
        echo "Bank 10000000 is invalid.\n";
    }
    // Account filter validation needs a previous call to the bank filter.
    if (filter_var("12345", FILTER_CALLBACK, $bav->getValidAccountFilterCallback())) {
        echo "Account 12345 is valid.\n";
    } else {
        echo "Account 12345 is invalid.\n";
    }
    // Print name of the bank
    $agency = $bav->getMainAgency("10000000");
    echo "{$agency->getName()} {$agency->getCity()}\n";
    /**
     * Are there any more agencies?
     */
    print_r($bav->getAgencies("10000000"));
} catch (BAVException $error) {
    die("Some error happened in the data backend.");
}
/**
 * Now have a look at the special features of PDODataBackend. Note that
 * the script will exit now if the PDO object could not be created. You should
 * edit the PDO object to create a valid DBS connection.
 */
use malkusch\bav\PDODataBackendContainer;
try {
    /*
     * Create the PDO container. If you intend to do so you should
     * create the file bav/configuration.php and return a Configuration which
     * uses PDODataBackendContainer.
     *