예제 #1
0
 /**
  * 
  * @return boolean TRUE on success
  * @throws FileMakerException
  */
 private function _commitAdd()
 {
     $addCommand = $this->fm->newAddCommand($this->layout->getName(), $this->fields);
     $result = $addCommand->execute();
     $records = $result->getRecords();
     return $this->_updateFrom($records[0]);
 }
예제 #2
0
 $newRelatedRecord->setField('id_sample', $record->getField('id'));
 $newRelatedRecord->setField('text_field', "NEW RELATED RECORD");
 $newRelatedRecord->setField('number_field', rand(1, 1000));
 $newRelatedRecord->setField('date_field', date('m/d/Y', $time));
 $newRelatedRecord->setField('time_field', date('H:i:s', $time));
 $newRelatedRecord->setField('timestamp_field', date('m/d/Y H:i:s', $time));
 $newRelatedRecord->commit();
 echo '<span style="color:green">SUCCESS</span>' . PHP_EOL . PHP_EOL;
 echo "Check if parent's relatedSet has been updated... ";
 echo (sizeof($record->getRelatedSet($relatedSetName)) == $currentRelatedSetCount + 1 ? '<span style="color:green">SUCCESS</span>' : '<span style="color:red">FAIL</span>') . PHP_EOL . PHP_EOL;
 echo "test duplicate record... ";
 $duplicateCommand = $fm->newDuplicateCommand($layout->getName(), $record->getRecordId());
 $result = $duplicateCommand->execute();
 echo 'New record count ' . $result->getTableRecordCount() . '... <span style="color:green">SUCCESS</span>' . PHP_EOL . PHP_EOL;
 echo "test create record... ";
 $newRecord = $fm->newAddCommand($layout->getName());
 $time = time();
 $newRecord->setField('id_sample', $record->getField('id'));
 $newRecord->setField('text_field', "NEW RELATED RECORD");
 $newRecord->setField('number_field', rand(1, 1000));
 $newRecord->setField('date_field', date('m/d/Y', $time));
 $newRecord->setField('time_field', date('H:i:s', $time));
 $newRecord->setField('timestamp_field', date('m/d/Y H:i:s', $time));
 $result = $newRecord->execute();
 $recordId = $result->getFirstRecord()->getRecordId();
 echo 'New record count ' . $result->getTableRecordCount() . '... ';
 echo '<span style="color:green">SUCCESS</span>' . PHP_EOL . PHP_EOL;
 echo "test delete record... ";
 $delCommand = $fm->newDeleteCommand($layout->getName(), $recordId);
 $result = $delCommand->execute();
 echo 'New record count ' . $result->getTableRecordCount() . '... <span style="color:green">SUCCESS</span>' . PHP_EOL . PHP_EOL;