More information o importer REST response (refs #63)
This commit is contained in:
parent
f2fe699369
commit
4a4c395b24
|
@ -28,7 +28,7 @@ class Importer_Handler {
|
|||
}
|
||||
|
||||
function add_to_queue(\Tainacan\Importer\Importer $importer_object) {
|
||||
$data = $importer_object->_to_Array();
|
||||
$data = $importer_object->_to_Array(true);
|
||||
$importer_object = $this->bg_importer->data($data)->save()->dispatch();
|
||||
return $importer_object;
|
||||
}
|
||||
|
|
|
@ -179,13 +179,20 @@ abstract class Importer {
|
|||
|
||||
}
|
||||
|
||||
public function _to_Array() {
|
||||
public function _to_Array($short = false) {
|
||||
$return = ['id' => $this->get_id()];
|
||||
foreach ($this->array_attributes as $attr) {
|
||||
$method = 'get_' . $attr;
|
||||
$return[$attr] = $this->$method();
|
||||
}
|
||||
$return['class_name'] = get_class($this);
|
||||
|
||||
if ($short === false) {
|
||||
$return['manual_collection'] = $this->manual_collection;
|
||||
$return['manual_mapping'] = $this->manual_mapping;
|
||||
$return['accepts'] = $this->accepts;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue