From ad8d8568b683e6935bec64abe88f79bf31706dd7 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 18 Aug 2010 15:22:43 -0300 Subject: Adding audit and finder classes, cleanup and organization --- classes/IsisAudit.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 classes/IsisAudit.php (limited to 'classes/IsisAudit.php') diff --git a/classes/IsisAudit.php b/classes/IsisAudit.php new file mode 100644 index 0000000..79cbe26 --- /dev/null +++ b/classes/IsisAudit.php @@ -0,0 +1,38 @@ +format['fields'] as $field) { + $field_name = $this->getFieldName($field); + $repetition = $this->nextRepetition(null, $field_name); + + // Check for repetitions. + if ($field['repeat'] && !$repetition) + { + echo "Field $field_name is configured for repetitions but no repetitions found.\n"; + } + elseif (!$field['repeat'] && $repetition) { + echo "Field $field_name is not configured for repetitions but a repetition was found.\n"; + } + + // Check for subfields. + foreach ($field['subfields'] as $subfield) { + $subfield_name = $this->getSubfieldName($field, $subfield); + $next_subfield = $isis->nextSubfield(null, $field_name, $subfield_name); + + if (!$next_subfield) { + echo "No occurrences found for field $field_name and subfield $subfield_name\n"; + } + } + } + } +} -- cgit v1.2.3