$name, 'type' => $type, 'content' => $content, ); } $records = get_records_by_domain_id($db, $zone['domain_id']); foreach ($records as $record) { foreach ($generated_templ_records as $generated_templ_record) { if ($record['name'] == $generated_templ_record['name'] && $record['type'] == $generated_templ_record['type'] && $record['content'] == $generated_templ_record['content']) { if (!record_relation_to_templ_exists($db, $zone['domain_id'], $record['id'], $zone['zone_templ_id'])) { add_record_relation_to_templ($db, $zone['domain_id'], $record['id'], $zone['zone_templ_id']); } break; } } } } migration_message('Relations between records and zone templates added successfully'); migration_save($db, $file_name);