Add new element.

@param DeclarationInterface $element

@return self
@throws ReactorException
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;
    }
199163
public function addElement($element, $name = null, $attrs = null) {
		switch (true) {
			case is_array($element):
				$newElement = new static($element);
				break;

			case $element instanceof self:
			case $element instanceof ListElement:
				$newElement = $element;
				break;

			default:
				$newElement = new ListElement($element, $attrs);
		}
		
		return parent::addElement($newElement, $name);
	}
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;
        }
    }
748042
public function addTag(TagInterface $tag)
    {
        if (!$this->tags->contains($tag)) {
            $this->tags->add($tag);
        }

        return $this;
    }
1163242
public function insertElement(AbstractElement $element)
	{
		if (!($element instanceof $this->elementClassName)) {
			throw new \InvalidArgumentException("Indexed element must be instance of " . $this->elementClassName);
		}

		$id = $element->getId();

		if (isset($this->elements[$id])) {
			throw new DuplicateElementException("Element \"$id\" already indexed.");
		}

		$this->elements[$id] = $element;

		$indexedAttrs = array_intersect_key($element->getAttributes(), $this->index);
		foreach ($indexedAttrs as $key => $newValue) {
			$this->index[$key][$newValue][$id] = $element;
		}
	}
1157567
protected static function create(array $element)
    {
        $class = self::getClassName($element['type']);
        $object = new $class;
        if ($object instanceof ContainerInterface) {
            static::execute($object, $element);
        }
        return $object;
    }
263336
protected function addRelAttribute(DOMElement $element)
	{
		$rel = $element->getAttribute('rel');
		if (preg_match('(\\S$)', $rel))
		{
			$rel .= ' ';
		}
		$rel .= 'noreferrer';

		$element->setAttribute('rel', $rel);
	}
1152155
private function createElement($element)
    {
        if ($element instanceof FilterElementInformationInterface) {
            $panelElement = new DefaultFilterElement();
            return $panelElement->setPropertyName($element->getPropertyName());
        }
        if ($element instanceof LimitElementInformationInterface) {
            return new DefaultLimitElement();
        }
        if ($element instanceof SearchElementInformationInterface) {
            return $this->buildSearchElement($element);
        }
        if ($element instanceof SortElementInformationInterface) {
            return new DefaultSortElement();
        }
        if ($element instanceof SubmitElementInformationInterface) {
            return new DefaultSubmitElement();
        }

        return null;
    }
1239958
public function processElement(\DOMElement $element, ContextInterface $context)
    {
        // Process default vocabulary registrations
        $context = $this->processVocab($element, $context);

        // Register vocabulary prefixes
        $context = $this->processPrefix($element, $context);

        // Create a property
        return $this->processProperty($element, $context);
    }
1098320
public function setDOM(DOMElement $element)
    {
        $this->_element = $this->_element->ownerDocument->importNode($element, true);
    }
852117
public function add($tag)
    {
        if (!$tag instanceof TagInterface) {
            throw new \InvalidArgumentException('This tag is not allowed');
        }
        if ($this->isUniqueTag($tag->getName())) {
            $this->removeByName($tag->getName());
        }

        return parent::add($tag);
    }
1326148
public function addComponent(ComponentInterface $component)
    {
        $this->getComponents()->push($component);
        $component->attachTo($this);
        return $this;
    }
893959
public function add($element, $postion=null, $type=null) {
		parent::add($element, $postion, $type);
	}
874219
public function addElement($element){

        $elements = $this->formElements;
        $elements[] = $element;

        $this->formElements = $elements;

        return $this;
    }
244875
public function addElement(BaseElement $element): ContainerElement
    {
        $element->parent = $this;
        $this->children[] = $element;
        if ($element instanceof ContainerElement) {
            return $element;
        }

        return $this;
    }
474530
public function add($element) {
		if (!in_array($element, $this->collection, true)) {
			$this->collection[$this->size()] = $element;
		}

		return $this;
	}
1232018
public T addElement(T element) {
		// make sure that elements are initialized
		getElements();
		if (!containsElement(this.elements, element)) {
			this.elements.add(element);
			element.addChangeListener(this.elementChangeListener);
			element.notifyState();
			return element;
		}
		throw new RuntimeException(element.toString() + " already exists");
	}