return one setting by name, useful to request root/course settings
that are, by definition, unique by name.

@param string $name name of the setting
@return base_setting
@throws base_plan_exception if setting name is not found.
543055
public function get_setting($name) {
        $result = null;
        if (isset($this->settings[$name])) {
            $result = $this->settings[$name];
        } else {
            throw new base_plan_exception('setting_by_name_not_found', $name);
        }
        return $result;
    }
1192453
function setting( $name )
    {
        $value = false;
        if( $this->hasSetting( $name ) )
        {
            $value = $this->Settings[$name];
        }
        else
        {
            eZDebug::writeWarning( "Setting '$name' doesn't exist", __METHOD__ );
        }

        return $value;
    }
1056593
public function getByBasenameOrDefault($name, $default=null)
    {
        return $this->where(function(File $f) use($name)
        {
            return $f->getBasename() == $name;
        })->singleOrDefault($default);
    }
1086432
public static function getByName($name)
    {
        $name = (string)$name;
        $class = get_called_class();
        if (isset(self::$instances[$class][$name])) {
            return self::$instances[$class][$name];
        }
        $const = $class . '::' . $name;
        if (!defined($const)) {
            throw new \InvalidArgumentException($const . ' not defined');
        }
        return self::$instances[$class][$name] = new $class(constant($const));
    }
854362
protected static function getProperty(string $name)
    {
        $prop = (new ReflectionClass(Builder::class))->getProperty($name);

        $prop->setAccessible(true);

        return $prop;
    }
49335
public function getByName($name)
    {
        $name = (string) $name;

        if (substr($name, 0, 1) !== ':') {
            $name = ':' . $name;
        }

        if (!isset($this->parametersByName[$name])) {
            throw new \Exception('Parameter is not defined !');
        }

        return $this->parametersByName[$name];
    }
1222607
public function getConfigurator(string $name): FieldSetConfigurator
    {
        if (!isset($this->configurators[$name])) {
            if (isset($this->serviceIds[$name])) {
                $configurator = $this->container->get($this->serviceIds[$name]);
            } elseif (class_exists($name)) {
                // Support fully-qualified class names.
                $configurator = new $name();
            } else {
                throw new InvalidArgumentException(sprintf('Could not load FieldSet configurator "%s".', $name));
            }

            if (!$configurator instanceof FieldSetConfigurator) {
                throw new InvalidArgumentException(sprintf('Configurator class "%s" is expected to be an instance of '.FieldSetConfigurator::class, $name));
            }

            $this->configurators[$name] = $configurator;
        }

        return $this->configurators[$name];
    }
1069932
public function actionGet ($name)
		{
			$class = $this->_modelClass;
			$object = $class::find()->select('name,value,description')->where([ 'name' => $name ])->asArray()->one();
			if ($object == null)
			{
				Console::printColor('Setting not found.', 'red');
				Yii::$app->end();
			}
			Console::printTable([ $object ], [ 'Name', 'Value', 'Description' ]);
		}
836441
public function setName($name)
    {
        $inflectMethod = $this->getInflectionMethod();
        $this->_name = Inflector::$inflectMethod($name);

        return $this;
    }
863894
public function getSetting($name, $default = '')
    {

        if (array_key_exists($name, $this->settings)) {
            $value = $this->settings[$name];
        } else {
            $value = $default;
        }

        return $value;

    }
1324754
public function setName($name)
    {
        $name = trim($name);

        if ($name !== '') {
            $this->name = $name;
        }

        return $this;
    }
1338223
public function setName($name)
    {
        $name = preg_replace("/([^\w\s\d\-_~,;:\[\]\(\).]|[\.]{2,})/", "", $name);
        $name = basename($name);
        $this->name = $name;

        return $this;
    }
1188452
public static function getHostByName($name) {
        if (!is_string($name)) throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if ($name == '')       throw new InvalidArgumentException('Invalid argument $name: "'.$name.'"');

        return \gethostbyname($name);
    }
964738
public function getService($name)
    {
        if (array_key_exists($name, $this->services)) {
            return $this->services[$name];
        } elseif (isset($this->serviceProviders[$name]) && $this->serviceProviders[$name] instanceof ServiceProviderInterface) {
            $service = $this->serviceProviders[$name]->instantiate();
            if (!empty($this->serviceConfiguration[$name]['persistent'])) {
                $this->setService($name, $service);
            }
            return $service;
        } else {
            throw new Exception("Requested service {$name} is not registered");
        }
    }
834637
public function create(string $name)
    {
        if ($this->locator->has($name)) {
            return $this->locator->get($name);
        }

        throw new \Exception(\sprintf('Filter "%s" was not found.', $name));
    }
717699
private function getProperty($name)
    {
        if (!Property::exists($this->properties, $name)) {
            throw new \Exception();
        }

        return Property::get($this->properties, $name);
    }
716568
public function getOption($name)
    {
        if (is_string($name)) {
            if (isset($this->options[$name])) {
                return $this->options[$name];
            } else {
                throw new \InvalidArgumentException("An option with the name '$name' doesn't exist.");
            }
        } else {
            throw new \InvalidArgumentException("Invalid type '" . gettype($name) . "' for argument 'name'.");
        }
    }