public function getParentCategoryIds($id) { $stmt =
$this->
getConnection()->
prepare('SELECT id, parent FROM s_categories WHERE id = :id AND parent IS NOT NULL'
);
$stmt->
execute([':id' =>
$id]);
$parent =
$stmt->
fetch(PDO::FETCH_ASSOC
);
if (!
$parent) { return [];
} $result =
[$parent['id'
]];
$parent =
$this->
getParentCategoryIds((int) $parent['parent'
]);
if ($parent) { $result =
array_merge($result,
$parent);
} $cache[$id] =
$result;
return $result;
} /**
* Returns count for paging rebuildCategoryPath()
*
* @param int $categoryId
*
* @return int
*/