PHP code example of bcdh / laravel-exist-db-client
1. Go to this page and download the library: Download bcdh/laravel-exist-db-client 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/ */
bcdh / laravel-exist-db-client example snippets
use BCDH\ExistDbClient\ExistDbClient;
$connection = new ExistDbClient();
$stmt = $connection->prepareQuery('for $someNode in collection("/SomeCollection")/someNodeName[./somePredicateAttribute=$someValueToBeBound] return $someNode');
$stmt->setSimpleXMLReturnType();
$stmt->bindVariable('someValueToBeBound', '5');
$resultPool = $stmt->execute();
$result = $resultPool->getAllResults();
foreach($result as $xml) {
var_dump($xml->somePredicateAttribute);
}