本文整理汇总了PHP中Export::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP Export::execute方法的具体用法?PHP Export::execute怎么用?PHP Export::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Export
的用法示例。
在下文中一共展示了Export::execute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testExportRestrictMissingFields
/**
* Test export with invalid restriction definition
*
* @expectedException \triagens\ArangoDb\ClientException
*/
public function testExportRestrictMissingFields()
{
if (!$this->hasExportApi) {
throw new ClientException('Invalid restrictions fields definition');
}
$export = new Export($this->connection, $this->collection, array("restrict" => array("type" => "include")));
$cursor = $export->execute();
}
示例2: dirname
<?php
namespace triagens\ArangoDb;
require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'init.php';
try {
$connection = new Connection($connectionOptions);
// creates an export object for collection 'users'
$export = new Export($connection, 'users', array("batchSize" => 5000, "_flat" => true, "flush" => true, "restrict" => array("type" => "include", "fields" => array("_key", "_rev"))));
// execute the export. this will return a special, forward-only cursor
$cursor = $export->execute();
// now we can fetch the documents from the collection in blocks
while ($docs = $cursor->getNextBatch()) {
// do something with $docs
print sprintf("retrieved %d documents", count($docs)) . PHP_EOL;
}
} catch (ConnectException $e) {
print $e . PHP_EOL;
} catch (ServerException $e) {
print $e . PHP_EOL;
} catch (ClientException $e) {
print $e . PHP_EOL;
}