I have a file-uploading-processor with array output. How I can add this array to database?
That's my processor's code:
class ModCLJsonUploadProcessor extends modProcessor {
public $languageTopics = ['modcl'];
public function process() {
$file = fopen($_FILES['json-file']['tmp_name'], 'r');
$json = fread($file, $_FILES['json-file']['size']);
$objs = json_decode($json);
$english = array();
for ($i = 0; $i < count($objs); $i++) {
$english[$i] = $objs[$i]->{'name'};
}
return $this->success($english);
}
}
return 'ModCLJsonUploadProcessor';
I tried to use the native modObjectCreateProcessor, but it does not support arrays.