本文整理汇总了PHP中FileMaker::newFindAllCommand方法的典型用法代码示例。如果您正苦于以下问题:PHP FileMaker::newFindAllCommand方法的具体用法?PHP FileMaker::newFindAllCommand怎么用?PHP FileMaker::newFindAllCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileMaker
的用法示例。
在下文中一共展示了FileMaker::newFindAllCommand方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FileMaker
* Requirements:
* 1. Working FileMaker Server installation
* 2. 'FMPHP_Sample' database hosted in FileMaker Server
*
*/
// Include FileMaker API
require_once 'FileMaker.php';
// Create a new connection to FMPHP_Sample database.
// Location of FileMaker Server is assumed to be on the same machine,
// thus we assume hostspec is api default of 'http://localhost' as specified
// in filemaker-api.php.
// If FMSA web server is on another machine, specify 'hostspec' as follows:
// $fm = new FileMaker('FMPHP_Sample', 'http://10.0.0.1');
$fm = new FileMaker('CAROSEL_online_13001');
// Create FileMaker_Command_Find on layout to search
$findCommand =& $fm->newFindAllCommand('CAROSEL_online_13001');
// Sort records in descending 'Title' order
$findCommand->addSortRule('Title', 1, FILEMAKER_SORT_ASCEND);
// Execute find command
$result = $findCommand->execute();
if (FileMaker::isError($result)) {
echo "Error: " . $result->getMessage() . "\n";
exit;
}
// Get array of found records
$records = $result->getRecords();
// Print out found records
// Setup row count variable to alternate row background color
$row = 0;
foreach ($records as $record) {
// if $row is odd, set class of <tr> to alt-row-color
示例2: FileMaker
// configure a connection to FileMaker Server Advanced
$contactsListConnection = new FileMaker('Contacts.fp7', $serverIP . ':' . $webCompanionPort, $webUN, $webPW);
// set database and layout information
$contactsListQuery = $contactsListConnection->newFindCommand('web_list');
// add find parameters
foreach ($searchRecordsArray as $fieldName => $fieldValue) {
$contactsListQuery->addFindCriterion($fieldName, $fieldValue);
}
// retrieve the records in this database matching the specified parameters available to the current user
$contactsObject = $contactsListQuery->execute();
} else {
// otherwise, find all records
// configure a connection to FileMaker Server Advanced
$contactsListConnection = new FileMaker('Contacts.fp7', $serverIP . ':' . $webCompanionPort, $webUN, $webPW);
// create a new findall query
$contactsListQuery = $contactsListConnection->newFindAllCommand('web_list');
// perform query
$contactsObject = $contactsListQuery->execute();
}
$fuzzyData = new FX_Fuzzy_Debugger($contactsListConnection, $contactsObject);
?>
<html>
<head>
<title>FX Error Tester</title>
</head>
<body>
<h1>Contact List</h1>
<table border="1">
<tr>
<th>First Name</th>
<th>Last Name</th>
示例3: testNewFindAllCommand
/**
* @covers \airmoi\FileMaker\FileMaker::newFindAllCommand
* @SuppressWarnings(PHPMD.Superglobals)
*/
public function testNewFindAllCommand()
{
$command = $this->fm->newFindAllCommand('sample');
if (!$GLOBALS['OFFICIAL_API']) {
$this->assertInstanceOf(Command\FindAll::class, $command);
} else {
$this->assertInstanceOf(\FileMaker_Command_FindAll::class, $command);
}
$result = $command->execute();
if (!$GLOBALS['OFFICIAL_API']) {
$this->assertInstanceOf(Object\Result::class, $result);
} else {
$this->assertInstanceOf(\FileMaker_Result::class, $result);
}
$this->assertEquals(50, $result->getFoundSetCount());
}