Adds an element to the container

@param ElementInterface $element

@return self|$this|ContainerInterface
356274
public function add(ElementInterface $element)
    {
        if (null === $element->getName()) {
            $this->data[] = $element;
            return $this;
        }
        $this->data[$element->getName()] = $element;
        return $this;
    }
39499
protected function renderElement(ElementInterface $element)
    {
        $collection = $this->getAttributesCollection($element);

        $this->addElementChildren($element, $collection);
        $this->addElementDependencies($element, $collection);
        $this->addElementRules($element, $collection);

        return $this->formatter->formatAttributesCollection($collection);
    }
2648
public function addElement(array $element)
    {
        $elementXml = $this->parseElement($element);
        $this->schema->appendChild($elementXml);
        return 'tns:' . $element['name'];
    }
1215805
public function renderRow(ElementInterface $element)
    {
        /* @var $rowPlugin \SxBootstrap\View\Helper\Bootstrap\Form\ControlGroup */
        $rowPlugin   = $this->getView()->plugin('sxb_form_control_group');
        $rowPlugin   = $rowPlugin();
        $errors      = $this->renderError($element);
        $label       = $this->renderLabel($element);
        $description = $this->renderDescription($element);
        $controls    = $this->renderControls($element, null !== $errors ? $errors : $description);

        if (null !== $errors) {
            $rowPlugin->error();
        }

        $rowPlugin->addContents(array(
            $label,
            $controls,
        ));

        return $rowPlugin;
    }
205298
private function addElementByStage(
        $element,
        $stage
    ) {
        if (!isset($this->elementsStoredByStage[$stage])) {
            $this->elementsStoredByStage[$stage] = [];
        }

        $elementId = spl_object_hash($element);
        $this->elementsStoredByStage[$stage][$elementId] = $element;

        return $this;
    }
503931
public function addAll($elements)
    {
        if ($elements instanceof CollectionInterface) {
            $elements = $elements->toArray();
        } else {
            $elements = array_values($elements);
        }
        $this->elements = array_merge($this->elements, $elements);
        return $this;
    }
547145
public function add(DeclarationInterface $element): Aggregator
    {
        $reflector = new \ReflectionObject($element);

        $allowed = false;
        foreach ($this->allowed as $class) {
            if ($reflector->isSubclassOf($class) || get_class($element) == $class) {
                $allowed = true;
                break;
            }
        }

        if (!$allowed) {
            $type = get_class($element);
            throw new ReactorException("Elements with type '{$type}' are not allowed");
        }

        $this->elements[] = $element;

        return $this;
    }
109769
public function addElement($element, $name = null) {
		if ($name === null) {
			$this->_elements[] = $element;
		} else {
			$this->_elements[$name] = $element;
		}
		
		return $this;
	}
1048685
public function add($element, $index = null) {
		if ($index === null) {
			$this->collection[$this->size()] = $element;
		} else {
			array_splice($this->collection, $index, 0, $element);
		}
		
		return $this;
	}
857933
protected function initFormElement(ElementInterface $element)
    {
        $this->name($element->getName())->type('text');

        $this->getElement()->addAttributes($element->getAttributes());

        $type = $element->getAttribute('type');

        if (null !== $type) {
            $this->type(strtolower($type));
        }

        $this->value($element->getValue());

        return $this;
    }
1298192
public function add($element) {
        $currentValue = $this->getRawValue();

        if (!in_array($element, $currentValue)) {
            $currentValue[] = $element;
            $this->setRawValue($currentValue);
        }

        return $this;
    }
948665
public function addElement($element)
    {
        if ($this->processing === 'B') {
            $this->pdf->addBody($element);

            return;
        }

        if ($this->processing === 'H') {
            $this->pdf->addHeader($element);

            return;
        }

        if ($this->processing === 'F') {
            $this->pdf->addFooter($element);

            return;
        }
    }
270840
protected function setElementClass(ElementInterface $element)
    {
        $class = $element->getAttribute('class');
        $type  = $element->getOption('type') ? : self::TYPE_DEFAULT;

        if (!in_array($type, self::TYPES, true)) {
            throw new Exception\DomainException(sprintf(
                '%s requires that the button type is one of "' . implode('", "', self::TYPES) . '"',
                __METHOD__
            ));
        }

        if ($class) {
            $class .= ' ';
        }
        $class .= 'btn btn-' . $type;
        $element->setAttribute('class', $class);
    }
586218
protected function createAndAddChild(\DOMElement $element, ContextInterface $context)
    {
        $thing = $this->getThing(
            trim($element->getAttribute('itemtype')) ?: null,
            trim($element->getAttribute('itemid')) ?: null,
            $context
        );

        // Process item references
        $this->processItemReferences($element, $context, $thing);

        // Add the new thing as a child to the current context
        // and set the thing as parent thing for nested iterations
        return $context->addChild($thing)->setParentThing($thing);
    }
515526
public function addElement(Element $element): Element
    {
        if ($element instanceof FormStatus) {
            if ($this->hasStatus === true) {
                throw new InvalidArgumentException('Form can contain only one FormStatus element');
            }
            $this->hasStatus = true;
        }
        return parent::addElement($element);
    }
1263491
public function setElements(array $elements)
    {
        if (($content = $this->getContent()) instanceof ElementsInterface) {
            $content->setElements($elements);
        }

        return $this;
    }
888495
public function add($elements)
    {
        if (is_array($elements)) {
            foreach ($elements as $element) {
                $this->add($element);
            }
        } else {
            $this->collections->add($elements);
        }

        return $this;
    }