@param ElementInterface[] $elements

@return CollectionElement
165412
public function withElement(ElementInterface ...$elements): CollectionElement
    {
        array_walk(
            $elements,
            function (ElementInterface $element) {
                $this->elements[$element->name()] = $element;
            }
        );

        return $this;
    }
579878
public function afterElementDelete (ElementInterface $element)
	{
		SimpleMap::getInstance()->map->softDeleteField($this, $element);
		parent::afterElementDelete($element);
	}
1072279
private function removeElements( $elements ) {
		$list = $elements;
		if ( $elements instanceof \DOMNodeList ) {
			$list = [];
			foreach ( $elements as $element ) {
				$list[] = $element;
			}
		}
		/** @var $element \DOMElement */
		foreach ( $list as $element ) {
			if ( $element->parentNode ) {
				$element->parentNode->removeChild( $element );
			}
		}
		return $list;
	}
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];
    }
612767
public function removeAll($elements)
    {
        if ($elements instanceof CollectionInterface) {
            $elements = $elements->toArray();
        }
        $this->elements = array_values(
            array_udiff(
                $this->elements,
                $elements,
                function ($a, $b) {
                    if ($a === $b) {
                        return 0;
                    } elseif (is_int($a) && is_object($b)) {
                        return -1;
                    } elseif (is_object($a) && is_int($b)) {
                        return 1;
                    } elseif ($a < $b) {
                        return -1;
                    } else {
                        return 1;
                    }
                }
            )
        );
        foreach ($this->subLists as $subList) {
            $subList->removeAll($elements, true);
        }
        return $this;
    }
224333
public function classes(array $classes) : Element
    {
        $this->classes = array_merge($this->classes, $classes);

        return $this;
    }
437721
public function addElement(Element $element)
    {
        if (!in_array($element, $this->elements, true)) {
            array_push($this->elements, $element);
        }
        return $this;
    }
50722
public function append($elements)
    {
        if (!empty($elements)) {
            $elements = is_array($elements) ? $elements : [$elements];

            foreach ($elements as $element) {
                if ($element instanceof Image || $element instanceof Text) {
                    $this->elementList[] = $element;
                }
            }
        }

        return $this;
    }
1285660
public function add(ElementInterface $element)
    {
        if ($element instanceof File) {
            $this->setAttribute('enctype', 'multipart/form-data');
        }
        return parent::add($element);
    }
526331
public function createService(ServiceLocatorInterface $elements)
    {
        $services = $elements->getServiceLocator();
        /* @var $options FormOptionsInterface */
        $options = $services->get(ModuleOptions::class);

        $creationOptions = $options->toArray();
        $creationOptions['label'] = 'Sign in';

        // Use submit button by default
        if (!isset($creationOptions['use_submit_element'])) {
            $creationOptions['use_submit_element'] = true;
        }

        return new Login('login-form', $creationOptions);
    }
1057789
protected function addElementsToIndexes($elements, array $indexes): void
    {
        if (!is_array($elements)) {
            $elements = [$elements];
        }

        /** @var DescriptorAbstract $element */
        foreach ($elements as $element) {
            /** @var Collection $collection */
            foreach ($indexes as $collection) {
                $collection->set($this->getIndexKey($element), $element);
            }
        }
    }
796460
public function filterElements($elements){
        $this->elementsToSearch = is_array($elements) ? $elements : [$elements];
        foreach($this->elementsToSearch as $key=>$elementName){
            $this->parseElement($elementName);
        }
        return $this->parsedElements;
    }
854651
protected function renderType(ElementInterface $element)
    {
        $value = $this->getElementValue($element);
        $type  = gettype($value);

        if (isset($this->typeMap[$type])) {
            return $this->renderHelper($this->typeMap[$type], $value, $element);
        }

        return;
    }
403033
private function filterElements(array $elements): array
    {
        $filteredElements = [];

        foreach ($elements as $element) {
            if (!$this->elementExcluder->isExcluded($element) && $this->hasUrlAttribute($element)) {
                $filteredElements[] = $element;
            }
        }

        return $filteredElements;
    }
1172716
public function flatten(array $elements)
    {
        $level = [];

        foreach ($elements as $node)
        {
            if (is_array($node))
            {
                $level = array_merge($level, $this->flatten($node));
            }
            else
            {
                $level[] = $node;
            }
        }

        return $level;
    }
749150
public function add(ElementInterface $element)
    {
        $id = $element->id;

        if ($id === null) $id = $this->generateId();

        $this->checkId($id);

        $this->objects[$id] = $element;
    }
85322
public function render( ElementInterface $element )
    {
        if ( ! $element instanceof Properties )
        {
            throw new Exception\InvalidArgumentException( sprintf(
                '%s requires that the element is of type Grid\Customize\Form\Element\Properties',
                __METHOD__
            ) );
        }

        $name = $element->getName();
        if ( empty( $name ) && $name !== 0 )
        {
            throw new Exception\DomainException( sprintf(
                '%s requires that the element has an assigned name; none discovered',
                __METHOD__
            ) );
        }

        $attributes = $element->getAttributes();
        $value      = (array) $element->getValue();
        $addAttr    = array(
            'name'      => $name,
            'required'  => empty( $attributes['required'] ) ? null : 'required',
        );

        unset( $attributes['name'] );
        unset( $attributes['required'] );
        $this->validTagAttributes = $this->validContainerAttributes;
        return sprintf(
            '<dl %s>%s</dl>',
            $this->createAttributesString( $attributes ),
            $this->renderProperties( $value, $addAttr )
        );
    }