public function deleteCategory(int $categoryID, int $moveChildrenTo = 0) : bool
{
if ($moveChildrenTo <= 0) {
$moveChildrenTo = null;
}
$this->db->beginTransaction();
try {
$this->db->update('hull_blog_posts', ['category' => $moveChildrenTo], ['category' => $categoryID]);
$this->db->delete('hull_blog_categories', ['categoryid' => $categoryID]);
} catch (DBException $ex) {
$this->db->rollBack();
return false;
}
\Airship\clear_cache();
return $this->db->commit();
}