public function updateAuthor(int $authorId, array $post) : bool
{
$this->db->beginTransaction();
$updates = ['name' => $post['name'] ?? '', 'byline' => $post['byline'] ?? '', 'bio_format' => $post['format'] ?? 'Markdown', 'biography' => $post['biography'] ?? ''];
if (!empty($post['slug'])) {
if ($this->updateAuthorSlug($authorId, $post)) {
$updates['slug'] = $post['slug'];
}
}
$this->db->update('hull_blog_authors', $updates, ['authorid' => $authorId]);
return $this->db->commit();
}