Return search area category instance by category name.

@param string $name Category name. If name is not valid will return default category.

@return \core_search\area_category
349052
public static function get_search_area_category_by_name($name) {
        if (key_exists($name, self::get_search_area_categories())) {
            return self::get_search_area_categories()[$name];
        } else {
            return self::get_search_area_categories()[self::get_default_area_category_name()];
        }
    }
736523
public function getListValue($category, $name, $default = null)
    {
        $model = $this->getModel($category);

        return $model->getListValue($name, $default);
    }
358156
public function get($name, $default = null)
    {
        return isset($this->filters[$name]) ? $this->filters[$name] : $default;
    }
937646
public function getQuery($name, $default = null)
    {
        return isset($this->gets[$name]) ? $this->gets[$name] : $default;
    }
386872
public function findByName( $name )
    {

        $result = $this->db->query(
            new Query( <<<SQL
SELECT
    t.oid AS oid,
    t.typname AS name,
    n.nspname as "schema",
    t.typlen AS length,
    t.typtype AS type,
    t.typcategory AS category,
    t.typarray AS "arrayType",
    t.typdefault AS default,
    t.typdefaultbin AS "defaultBin"
FROM
    pg_type AS t
INNER JOIN
    pg_namespace AS n ON n.oid = t.typnamespace
WHERE
    typname = %name:text% OR
    ( n.nspname || '.' || t.typname ) = %name:text%
SQL
,
                array(
                    'name' => $name
                )
            )
        )->fetch( Result::FETCH_SINGLE );

        return $this->initByData( $result );

    }
356122
public static function getInstance($name)
    {
        if (is_null(self::$instance)) {
            $arr = explode('.', $name);
            $company = $arr[0];
            $type = $arr[1];
            $className = self::$map[$company][$type];
            self::$instance = new $className;
        }

        return self::$instance;
    }
500647
public function getSection($name, $default = null)
    {
        return isset($this->getSections()[$name]) ? $this->getSections()[$name] : $default;
    }
1061974
public static function getInstance($category = self::CATEGORY_DEFAULT)
    {
        if (!isset(self::$instances[$category])) {
            self::$instances[$category] = new static($category);
        }
        return self::$instances[$category];
    }
457453
public static function instance($name = 'default')
	{
		if (\array_key_exists($name, static::$instances))
		{
			return static::$instances[$name];
		}

		if (empty(static::$instances))
		{
			\Config::load('db', true);
		}

		if ( ! ($config = \Config::get('db.mongo.'.$name)))
		{
			throw new \Mongo_DbException('Invalid instance name given.');
		}

		static::$instances[$name] = new static($config);

		return static::$instances[$name];
	}
404275
public function getListValue($name, $default = null)
    {
        $category = $this->getCategory();

        $list = $this->getCategoryConfig($category);

        foreach ($list as $context => $config) {
            $list[$context] = $this->getValue($context, $name, $default);
        }

        return $list;
    }
22119
public static function get($name)
    {
        $class = get_called_class();
    
        if (!isset(self::$instance[$class])) {
            self::$instance[$class] = new static();
        }
        
        return self::$instance[$class]->getExtensions()->get($name);
    }
752096
public function get($name)
    {
        $name = ltrim($name, '\\');
        if (! isset($this->instances[$name])) {
            $this->instances[$name] = $this->newInstance($name);
        }
        return $this->instances[$name];
    }
992486
public function getByName($name)
    {
        if (!isset($this->nameMap[$name])) {
            return null;
        }

        return $this->get($this->nameMap[$name]);
    }
1267771
public function top($name)
    {
        $stack = $this->getInstance($name);
        return $stack->isEmpty() ? false : $stack->top();
    }
1373860
public function name( $name = null )
	{
		if ( is_null( $name ) )
		{
			return $this->_instance_name;
		}
		
		$this->_instance_name = $name;
	}
1340325
function &addArea($name = null) {
            if (!$name) {
                $name = uniqid(microtime(true), true);
            }
            $this->areas[$name] = new Area();
            return $this->areas[$name];
        }
357076
protected static function getAlgorithm($name)
    {
        if (!isset(self::$algorithms[$name])) {
            self::$algorithms[$name] = new $name();
        }

        return self::$algorithms[$name];
    }