Beispiel #1
0
 echo 'Record count... ';
 $count = $result->getFetchCount();
 echo 'Expected 1, returned ' . $count . '... ' . ($count == 1 ? '<span style="color:green">SUCCESS</span>' : '<span style="color:red">FAIL</span>') . PHP_EOL . PHP_EOL;
 echo 'Record total count... ';
 $count = $result->getFoundSetCount();
 echo 'Expected 2, returned ' . $count . '... ' . ($count == 2 ? '<span style="color:green">SUCCESS</span>' : '<span style="color:red">FAIL</span>') . PHP_EOL . PHP_EOL;
 echo 'Try to get First Record... ';
 $record = $result->getFirstRecord();
 echo ($record instanceof \airmoi\FileMaker\Object\Record ? '<span style="color:green">SUCCESS</span>' : '<span style="color:red">FAIL</span>') . PHP_EOL . PHP_EOL;
 echo 'Check if expected record (ID = 2)... ';
 echo 'returned ' . $record->getField('id') . '... ' . ($record->getField('id') == 2 ? '<span style="color:green">SUCCESS</span>' : '<span style="color:red">FAIL</span>') . PHP_EOL . PHP_EOL;
 echo 'Test Create CompoundFind... ';
 $request = $fm->newCompoundFindCommand($layout->getName());
 echo '<span style="color:green">SUCCESS</span>' . PHP_EOL . PHP_EOL;
 echo 'Test Create FindRequets... ';
 $findReq1 = $fm->newFindRequest($layout->getName());
 $findReq1->addFindCriterion('id', '1');
 $findReq2 = $fm->newFindRequest($layout->getName());
 $findReq2->addFindCriterion('id', '2...4');
 $findReq3 = $fm->newFindRequest($layout->getName());
 $findReq3->addFindCriterion('id', '3...4');
 $findReq3->setOmit(true);
 echo '<span style="color:green">SUCCESS</span>' . PHP_EOL . PHP_EOL;
 echo 'Add FindRequets to compoundFind... ';
 $request->add(1, $findReq1);
 $request->add(2, $findReq2);
 $request->add(3, $findReq3);
 echo '<span style="color:green">SUCCESS</span>' . PHP_EOL . PHP_EOL;
 echo 'Test adding sort rule to CompoundFind... ';
 $request->addSortRule('id', 1, FileMaker::SORT_DESCEND);
 echo '<span style="color:green">SUCCESS</span>' . PHP_EOL . PHP_EOL;