$resourceTypeArray = $resourceTypeObj->allAsArray(); $resourceTypeInserted++; } } } // If Resource Format is mapped, check to see if it exists $resourceFormatID = null; if ($jsonData['resourceFormat'] != '') { $index = searchForShortName($data[$resourceFormatColumn], $resourceFormatArray); if ($index !== null) { $resourceFormatID = $resourceFormatArray[$index]['resourceFormatID']; } else { if ($index === null && $data[$resourceFormatColumn] != '') { $resourceFormatObj = new ResourceFormat(); $resourceFormatObj->shortName = $data[$resourceFormatColumn]; $resourceFormatObj->save(); $resourceFormatID = $resourceFormatObj->primaryKey; $resourceFormatArray = $resourceFormatObj->allAsArray(); $resourceFormatInserted++; } } } // If Subject is mapped, check to see if it exists $generalDetailSubjectLinkIDArray = array(); foreach ($jsonData['subject'] as $subject) { $generalSubjectID = null; if ($subject['column'] === "") { continue; } if ($subject['delimiter'] !== "") { $subjectArray = array_map('trim', explode($subject['delimiter'], $data[intval($subject['column']) - 1]));