Only fetch category when it exists

This commit is contained in:
Michael 2022-04-30 06:57:22 +00:00
parent fb3353d4bd
commit 1f43332a1d
2 changed files with 9 additions and 0 deletions

View file

@ -111,6 +111,11 @@ class Category
return array_column($tags, 'name');
}
public static function existsForURIId(int $uri_id, int $uid)
{
return DBA::exists('post-category', ['uri-id' => $uri_id, 'uid' => $uid]);
}
/**
* Generates an array of files or categories of a given uri-id
*