public function getCategory($v)
    {
        $v = $this->buildCategoryId($v);

        return isset($this->categories[$v]) ? $this->categories[$v] : null;
    }
public function getCategory($v)
    {
        $v = $this->buildCategoryId($v);

        return isset($this->categories[$v]) ? $this->categories[$v] : null;
    }
public function getCategory ( $ v ) { $ v = $ this -> buildCategoryId ( $ v ) ; return isset ( $ this -> categories [ $ v ] ) ? $ this -> categories [ $ v ] : null ; }
Returns category by name or id.

@param string $v category name or id

@return Category|null return category object if provided name/id exists, else null
Returns category by name or id .