public function getSeriesTree($current = null, string $col = 'children', array $encountered = [], int $depth = 0) : array
{
if ($depth > 100) {
return [];
}
$this->db->run(\Airship\queryString('blog.series.tree', ['valueset' => $this->db->escapeValueSet($encountered, 'int')]), $current);
if (empty($rows)) {
return [];
}
foreach ($rows as $i => $row) {
$rows[$i][$col] = $this->getSeriesTree((int) $row['seriesid'], $col, $depth + 1);
}
return $rows;
}