fix export collection

This commit is contained in:
DavidBadura 2015-02-05 21:28:00 +00:00
parent 91e3fa947b
commit 28b61adc99
1 changed files with 5 additions and 15 deletions

View File

@ -33,7 +33,7 @@ class Taskwarrior
array( array(
'rc:' . $taskrc, 'rc:' . $taskrc,
'rc.data.location=' . $taskData, 'rc.data.location=' . $taskData,
'rc.json.array=false', 'rc.json.array=true',
'rc.confirmation=no', 'rc.confirmation=no',
), ),
$rcOptions $rcOptions
@ -157,21 +157,11 @@ class Taskwarrior
return $tasks; return $tasks;
} }
$jsons = explode("\n", $json);
foreach ($jsons as $row) {
if (trim($row) == "") {
continue;
}
$serializer = SerializerBuilder::create() $serializer = SerializerBuilder::create()
->addDefaultHandlers() ->addDefaultHandlers()
->build(); ->build();
$tasks[] = $serializer->deserialize($row, 'DavidBadura\Taskwarrior\Task', 'json'); return $serializer->deserialize($json, 'array<DavidBadura\Taskwarrior\Task>', 'json');
}
return $tasks;
} }
/** /**