get one or more elements by name

@param string $name of element or elements
@return FormElement|array
@throws \InvalidArgumentException
423762
public function getElementsByName($name) {

		if(isset($this->elements[$name])) {
			return $this->elements[$name];
		}
		
		throw new \InvalidArgumentException(sprintf("Unknown form element '%s'", $name));

	}
1196620
public function get($name)
    {
        if (isset($this->_handlers[$name])) {
           return $this->_handlers[$name];
        }
        $checker = $this->_classes['checker'];
        if ($checker::has($name)) {
           return $checker::get($name);
        }
        throw new InvalidArgumentException("Unexisting `{$name}` as validation handler.");
    }
162759
public function getCustomButton($name)
    {
        if (!$this->hasCustomButton($name)){
            throw new \InvalidArgumentException(
                sprintf('CustomButton: "%s" does not exist in the stack', $name)
            );
        }
    
        return $this->customButtons[$name];
    }
1297596
public function getAttribute($name)
    {
        if (!\array_key_exists($name, $this->attributes)) {
            throw new \InvalidArgumentException(sprintf('This token has no "%s" attribute.', $name));
        }

        return $this->attributes[$name];
    }
438348
public function &getElementByName( $name )
	{
		$defaultResult = array();

		if ( ! property_exists( $this, 'elements_by_name' ) )
		{
			$this->elements_by_name = array();

			foreach ( $this->elementIndex as $elementsKey => &$element )
			{
				$this->elements_by_name[ $element['name'] ]  = &$element;
			}
		}

		if ( isset( $this->elements_by_name[ $name ] ) )
		{
			return $this->elements_by_name[ $name ];
		}
		return $defaultResult;

		return isset( $this->elements_by_name[ $name ] ) ? $this->elements_by_name[ $name ] : $defaultResult;
	}
13686
public function GetElement($name)
    {
        $element = $this->Elements()->GetElement($name);
        if (!$element)
        {
            throw new \Exception(Trans('Core.Form.Error.ElementNotFound.Name_{0}', $name));
        }
        return $element;
    }
934309
public static function get($name)
    {
        if (!isset(static::$types[$name])) {
            if (!static::has($name)) {
                throw new \InvalidArgumentException(sprintf('The type "%s" does not exists.', $name));
            }

            static::$types[$name] = new static::$map[$name];
        }

        return static::$types[$name];
    }
891513
public function element(string $name): ElementInterface
    {
        if (! isset($this->elements[$name])) {
            throw new ElementNotFoundException(
                sprintf('The element with name <code>%s</code> does not exists', $name)
            );
        }

        return $this->elements[$name];
    }
626438
public function getAttribute($name)
    {
        if (!count($this)) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }
        $node = $this->getNode(0);
        return $node->hasAttribute($name) ? $node->getAttribute($name) : null;
    }
1103372
protected function findElement($name)
    {
        try {
            return $this->wd->findElement(WebDriverBy::id($name));
        } catch (\Exception $e) {
        }

        try {
            return $this->wd->findElement(WebDriverBy::name($name));
        } catch (\Exception $e) {
        }

        try {
            return $this->wd->findElement(WebDriverBy::cssSelector($name));
        } catch (\Exception $e) {
        }

        try {
            return $this->wd->findElement(WebDriverBy::xpath($name));
        } catch (\Exception $e) {
        }

        throw new CannotFindElement('Cannot find element: '.$value.' isn\'t visible on the page');
    }
519237
public function get($name)
    {
        if (isset($this->children[$name])) {
            return $this->children[$name];
        }

        throw new \InvalidArgumentException(sprintf('Menu entry %s does not have a child named "%s"', $this->name, $name));
    }
1057523
public function getOption($name) {
        if(!isset($this->options[$name])){
            throw new InvalidArgumentException(sprintf("The option name '%s' is invalid, available are %s.",$name, implode(",",array_keys($this->options))));
        }
        return $this->options[$name];
    }
7312
public function get_element($elementname) {
        if ($this->_form->elementExists($elementname)) {
            return $this->_form->getElement($elementname);
        } else {
            return false;
        }
    }
831739
public function getRow($name)
    {
        if (!isset($this->rows[$name])) {
            throw new \InvalidArgumentException(
                "Attempting to access unknown form row '$name'"
            );
        }

        return $this->rows[$name];
    }
1042639
public function getAction($name) {
        if(isset($this->actions[$name])) {
            return $this->actions[$name];
        } else {
            throw new InvalidArgumentException('Action does not exist: ' . $name);
        }
    }
481212
public function getField($name)
    {
        if ($this->has($name)) {
            return $this->fields[$name];
        }

        throw new \InvalidArgumentException(
            'Field with name ['. $name .'] does not exist in class '.get_class($this)
        );
    }
366951
public function createElement($name)
    {
        $elementClass = $this->classNameResolver->resolveElement($name);

        return $this->instantiateElement($elementClass);
    }