public function getMethodByName($name)
    {
        foreach ($this->methods as $method) {
            if ($method->getName() == $name) {
                return $method;
            }
        }

        throw new \InvalidArgumentException(sprintf('The method "%s" does not exists.', $name));
    }
public function getMethodByName($name)
    {
        foreach ($this->methods as $method) {
            if ($method->getName() == $name) {
                return $method;
            }
        }

        throw new \InvalidArgumentException(sprintf('The method "%s" does not exists.', $name));
    }
public function getMethodByName ( $ name ) { foreach ( $ this -> methods as $ method ) { if ( $ method -> getName ( ) == $ name ) { return $ method ; } } throw new \ InvalidArgumentException ( sprintf ( 'The method "%s" does not exists.' , $ name ) ) ; }
Return a method by name.

@param string $name The method name.

@return Mandango\Mondator\Definition\Method The method.

@throws \InvalidArgumentException If the method does not exists.

@api
Return a method by name .