Gets a MethodModel for a class method.

@param string $name The method name to reflect.

@return MethodModel
@throws ModelException if the method does not exist.
778897
public function getMethod($name)
    {
        if ($this->hasMethod($name)) {
            return $this->methods[$name];
        }
        throw new ModelException(
            'Method ' . $name . ' does not exist.'
        );
    }
685411
function getOwnMethod($name) {
    if (isset($this->methods[$name])) {
      return $this->methods[$name];
    }
    if ($this->methodsComplete) {
      return NULL;
    }
    if (array_key_exists($name, $this->methodsNotFound)) {
      return NULL;
    }
    $methodObj = $this->findOwnMethod($name);
    if (NULL === $methodObj) {
      $this->methodsNotFound[$name] = TRUE;
      return NULL;
    }
    $this->methods[$name] = $methodObj;
    return $methodObj;
  }
1241222
public function method($name)
    {
        $method = new Method($name);
        $this->container->put($name, $method);

        return $method;
    }
583576
public function getModel($name) {
        if(!isset($this->models[$name])){
            throw new RuntimeException(sprintf("The model document name '%s' is not added in chain model '%s'",$name,$this->id));
        }
        $this->models[$name]->setContainer($this->container);
        return $this->models[$name];
    }
531801
private function checkExist($name)
    {
        if (!$this->hasField($name)) {
            throw new ModelException(
                sprintf(
                    "Field '%s' is not defined in structure '%s'. Defined fields are {%s}",
                    $name,
                    get_class($this),
                    join(', ', array_keys($this->field_definitions))
                )
            );
        }

        return $this;
    }
623036
public function getMethod($name)
    {
        return (isset($this->_methods[$name])) ? $this->_methods[$name] : null;
    }
594987
public function getMethod($name)
    {
        if (parent::hasMethod($name) == false) {
            return null;
        }
        
        $moufRefMethod = new MoufReflectionMethod($this, $name);
        return $moufRefMethod;
    }
754643
public function getMethod($name)
    {
        if (!isset($this->methods[$name])) {
            throw new OutOfBoundsException(sprintf(
                'The method "%s" does not exist.',
                $name
            ));
        }

        return $this->methods[$name];
    }
616617
private function get(string $name){
		$method = 'magic_get_'.$name;

		return \method_exists($this, $method) ? $this->$method() : null;
	}
644988
public MethodModel getMethodModel(String _name, String _signature) throws AparapiException {
      if (CacheEnabler.areCachesEnabled())
         return methodModelCache.computeIfAbsent(MethodKey.of(_name, _signature));
      else {
         final ClassModelMethod method = getMethod(_name, _signature);
         return new MethodModel(method);
      }
   }
766778
public function getFunction($name)
    {
        if (!isset($this->functions[$name])) {
            throw new \LogicException('The template function "' . $name . '" was not found.');
        }

        return $this->functions[$name];
    }
1144644
public static function oneByName($name)
	{
		$model = self::all()
			->whereEquals('name', $name)
			->row();

		if (!$model)
		{
			$model = self::blank();
		}

		return $model;
	}
1116079
public static function getFormatTemplate($name) {
        $file = sprintf(
            '%s/Model/template/format/%s.html',
            __DIR__,
            $name
        );

        if (!file_exists($file)) {
            return null;
        }

        if (!isset(self::$templates[$name])) {
            self::$templates[$name] = file_get_contents($file);
        }

        return self::$templates[$name];
    }
471514
protected function getModelName($name = null)
    {
        $name = str_singular($this->meta['table']);

        $model = '';
        $pieces = explode('_', $name);
        foreach ($pieces as $k => $str) {
            $model = $model . ucwords($str);
        }

        return $model;
    }
531491
protected function getRelation($name)
    {
        $relation = $this->relations[$name];
        if ($relation instanceof self || (\is_array($relation) && $relation[0] instanceof self)) {
            return $relation;
        }

        $class = 'App\\Model\\' . $relation[1];
        /** @var Model $model */
        $model = new $class();

        switch ($relation[0]) {
            case self::HAS_ONE:
                $this->relations[$name] = $model->eq($relation[2], $this->__get($this->primary))->get();
                break;
            case self::HAS_MANY:
                $this->relations[$name] = $model->eq($relation[2], $this->__get($this->primary))->select();
                break;
            case self::BELONGS_TO:
                $this->relations[$name] = $model->get($this->__get($relation[2]));
                break;
            default:
                throw new ModelException("Relation $name not found.");
        }

        return $this->relations[$name];
    }
989484
public function getModule($name)
	{
		$factory = $this->getFactoryForModule($name);
		$definition = $this->getModuleDefinition($name);

		$factoryMethod = "createModule" . ucfirst($name);

		if (method_exists($factory, $factoryMethod)) {
			$module = $factory->$factoryMethod();
		} else {
			$moduleClass = $definition->getClass();
			$module = $this->createModule($moduleClass);
		}

		if (!$module) {
			$factoryClass = get_class($factory);
			throw new UnexpectedValueException(
				"Method '$factoryClass:createModule' does not return or create desired module '$name'"
			);
		}
		if (!($module instanceof IModule)) {
			$moduleClass = get_class($module);
			throw new UnexpectedValueException("'$moduleClass' is not instance of Annotate\\Modules\\IModule");
		}
		$this->module = $module;
		$this->activeModuleName = $name;

		return $module;
	}
1323011
private function createMethod(string $name): MethodInterface
    {
        $methodClass = $clientClass = null;

        foreach (['Postage', 'Tracking', 'Withdrawal'] as $ns) {
            $class = 'Ekyna\\Component\\Colissimo\\' . $ns . '\\Method\\' . ucwords($name) . 'Method';
            if (class_exists($class)) {
                $methodClass = $class;
                $clientClass = 'Ekyna\\Component\\Colissimo\\' . $ns . '\\Client';
                break;
            }
        }

        if (is_null($methodClass)) {
            throw new RuntimeException("Method {$name} does not exist");
        }

        return new $methodClass($this->factory->getClient($clientClass));
    }