Backend\Modules\Blog\Engine\Model::getCategoryId PHP Method

getCategoryId() public static method

Get a category id by title
public static getCategoryId ( string $title, string $language = null ) : integer
$title string The title of the category.
$language string The language to use, if not provided we will use the working language.
return integer
    public static function getCategoryId($title, $language = null)
    {
        $title = (string) $title;
        $language = $language !== null ? (string) $language : BL::getWorkingLanguage();
        return (int) BackendModel::getContainer()->get('database')->getVar('SELECT i.id
             FROM blog_categories AS i
             WHERE i.title = ? AND i.language = ?', array($title, $language));
    }