| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php /** @noinspection PhpUnhandledExceptionInspection */
- /**
- * @var Template $template
- * @var object[] $fields
- * @var resource $handle
- * @var Test[] $tests
- * @var Constraint $year_cycle_constraint
- */
- $config = $template->getConfiguration();
- $field_names = [
- "Internal ID",
- "Location Name",
- "Template Name",
- "Date",
- "Test ID",
- "Test Cost",
- ];
- fputcsv($handle, $field_names);
- foreach($tests as $test) {
- $location = $test->getLocation();
- $project = $test->getProject();
- $output = [];
- $output[] = $location->internal_id;
- $output[] = $location->name;
- $output[] = $template->name;
- $output[] = $test->getDateTimeStart()->format("d/m/Y");
- $output[] = $test->id;
- $output[] = $test->getCustomerFee();
- fputcsv($handle, $output);
- }
|