Update Category class

This commit is contained in:
DariusIII
2019-01-25 15:23:16 +01:00
parent 6953532a8d
commit b16a31c380
2 changed files with 5 additions and 3 deletions
+4 -3
View File
@@ -442,12 +442,13 @@ class Category extends Model
* Return the parent and category name from the supplied categoryID.
*
*
* @param $ID
* @param $categoryId
*
* @return string
*/
public static function getNameByID($ID): string
public static function getNameByID($categoryId): string
{
$cat = self::query()->where('id', $ID)->first();
$cat = self::query()->where('id', $categoryId)->first();
return $cat !== null ? $cat->parent->title.' -> '.$cat->title : '';
}