protected function makeGenericSlug(string $title, string $table, string $column = 'slug') : string
{
if (IDE_HACKS) {
$this->db = \Airship\get_database();
}
$query = 'SELECT count(*) FROM ' . $this->db->escapeIdentifier($table) . ' WHERE ' . $this->db->escapeIdentifier($column) . ' = ?';
$slug = $base_slug = \Airship\slugFromTitle($title);
$i = 1;
while ($this->db->cell($query, $slug) > 0) {
$slug = $base_slug . '-' . ++$i;
}
return $slug;
}