public function getCategoryParents(int $categoryId, int $depth = 0) : array
{
if ($depth > 100) {
return [];
}
$parent = $this->db->cell('SELECT parent FROM hull_blog_categories WHERE categoryid = ?', $categoryId);
if (empty($parent)) {
return [];
}
$recursion = $this->getCategoryParents($parent, $depth + 1);
\array_unshift($recursion, $parent);
return $recursion;
}