PHP code example of phil / library-bundle
1. Go to this page and download the library: Download phil/library-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phil / library-bundle example snippets
use Phil\LibraryBundle\Application\Exception\LoanRefused;
use Phil\LibraryBundle\Application\Loans;
try {
$loan = $loans->lend('G-0042', $member); // due at the end of the 21st day
} catch (LoanRefused $refused) {
$refused->reason; // taken, overdue, limit…
}
$loans->giveBack('G-0042', CopyCondition::Incomplete, 'Two tiles missing.');