protected function exportData($export_path, $items)
{
foreach ($items as $item) {
$data = [];
$data['id'] = $item->id;
$data['title'] = $item->title;
$data['username'] = $item->username;
$data['body'] = $item->body;
$data['published'] = $item->published === "0" ? "false" : "true";
$data['created_at'] = $item->created_at;
$data['updated_at'] = $item->updated_at;
$item_tags = $this->itemService->getTagsToArray($item);
$tags = '';
foreach ($item_tags as $item_tag) {
$tags .= "{$item_tag['name']} ";
}
$data['tags'] = str_replace(' ', ', ', trim($tags));
$output = $this->generateOutputBody($data);
$filename = date("Y-m-d", strtotime($data['updated_at'])) . '-' . $data['title'] . '-(id' . $data['id'] . ').html.md';
file_put_contents($export_path . $filename, $output);
echo ".";
}
}