Guest User

Untitled

a guest
Jan 14th, 2020
102
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $search_results = array();
  4.  
  5. $queries = array(
  6.     'Quantity in Stock' => ['term' => 0, 'omit' => FALSE],
  7.     'Quantity in Stock' => ['term' => '<100', 'omit' => TRUE],
  8.     'Quantity in Stock' => ['term' => 0, 'omit' => TRUE],
  9.     'Cover Photo Credit' => ['term' => 'The Dallas Morning News', 'omit' => TRUE],
  10. );
  11.  
  12. $fm = new FileMaker('FMPHP_Sample');
  13.  
  14. // Create FileMaker_Command_CompoundFind object on layout to search
  15. $compoundFind = $fm->newCompoundFindCommand('Form View');
  16.  
  17. $inc = 0;
  18. foreach($queries as $fiel => $lookup) {
  19.  
  20.     $inc++;
  21.     $findreq = $fm->newFindRequest('Form View');
  22.     $findreq->addFindCriterion($field, $lookup['term']);
  23.     $findreq->setOmit($lookup['omit']);
  24.     $compoundFind->add($inc, $findreq);
  25.  
  26. }
  27.  
  28.  
  29. // Set sort order
  30. $compoundFind->addSortRule('Title', 1, FILEMAKER_SORT_DESCEND);
  31.  
  32. // Execute compound find command
  33. $result = $compoundFind->execute();
RAW Paste Data