Returns first block element.

@param string $element_name      Element name.
@param string $modificator_name  Modificator name.
@param string $modificator_value Modificator value.

@return NodeElement[]|null
176757
public function getElement($element_name, $modificator_name = null, $modificator_value = null)
	{
		return $this->getObject()->getElement($element_name, $modificator_name, $modificator_value);
	}
815249
private NamedOutputBlockContext findAndRemoveBlock(List<NamedOutputBlockContext> blocks, String name) {

    if(blocks == null) {
      return null;
    }

    Iterator<NamedOutputBlockContext> blockIter = blocks.iterator();
    while (blockIter.hasNext()) {
      NamedOutputBlockContext block = blockIter.next();
      String blockName = name(block);
      if(name.equals(blockName)) {
        blockIter.remove();
        return block;
      }
    }

    return null;
  }
811318
private String getElementValue(Element parent, String elementName) {
        String value = null;
        NodeList nodes = parent.getElementsByTagName(elementName);
        if (nodes.getLength() > 0) {
            value = nodes.item(0).getChildNodes().item(0).getNodeValue();
        }
        return value;
    }
179822
public function recordElement(string $node_name, string $record_offset_attribute_name = ''): self
    {
        $clone = clone $this;
        $clone->record_name = $this->filterElementName($node_name);
        $clone->offset_attr = $this->filterAttributeName($record_offset_attribute_name);

        return $clone;
    }
1220652
public function getElementMinOccurs($name)
    {
        foreach ($this->element->getElementsByTagName('element') as $element) {
            if ($element->getAttribute('name') == $name) {
                $minOccurs = $element->getAttribute('minOccurs');
                if ($minOccurs === '') {
                    return null;
                }
                return (int) $minOccurs;
            }
        }
        return null;
    }
765761
public  function getList( $key, array $default_value = NULL )
    {
        $value = $this->getPropertyNodeValue( $key );

        // return default value if the element is null
        if ( NULL === $value ){
            return NULL === $default_value ? NULL : new ArrayList($default_value);
        }

        return new ArrayList($value);
    }
988464
private function parseSetResultNodes(DOMElement $child, $name, array &$result = null)
    {
        if (!(is_array($result[$name]) && $this->valueIsList($result[$name]))) {
            return false;
        }

        $value = static::getPhpValue($child, null, $this);

        if (is_array($value) && $this->valueIsList($value)) {
            return $result[$name] = array_merge($result[$name], $value);
        }

        return $result[$name][] = $value;
    }
486826
public static int compareModifierVisibility(Element a, Element b) {


    // a better
    if (a.getModifiers().contains(Modifier.PUBLIC) && !b.getModifiers().contains(Modifier.PUBLIC)) {
      return -1;
    }

    if (isDefaultModifier(a.getModifiers()) && !isDefaultModifier(b.getModifiers())) {
      return -1;
    }

    if (a.getModifiers().contains(Modifier.PROTECTED) && !b.getModifiers().contains(Modifier.PROTECTED)) {
      return -1;
    }


    // b better
    if (b.getModifiers().contains(Modifier.PUBLIC) && !a.getModifiers().contains(Modifier.PUBLIC)) {
      return 1;
    }

    if (isDefaultModifier(b.getModifiers()) && !isDefaultModifier(a.getModifiers())) {
      return 1;
    }

    if (b.getModifiers().contains(Modifier.PROTECTED) && !a.getModifiers().contains(Modifier.PROTECTED)) {
      return 1;
    }

    // Same
    return 0;
  }
643112
public function createElement(Node $parent, $name)
    {
        foreach ($this->registry[ElementExtension::class] as $extension) {
            $node = $extension->createElement($parent, $name);
            if ($node) {
                return $node;
            }
        }

        return null;
    }
143877
public function BEM($block = null, $element = null, $modifiers = []): array
    {
        if (!isset($block) || !is_string($block) || !$block) {
            return [];
        }
        $baseClass = $element ? "{$block}__{$element}" : "{$block}";
        $classes = [$baseClass];

        if (isset($modifiers)) {
            $modifiers = self::modifierArray($modifiers);
            foreach ($modifiers as $value) {
                $classes[] = "{$baseClass}--{$value}";
            }
        }

        return $classes;
    }
798575
public static Element getChild( Element root, String name )
    {
        if( null == root )
        {
            return null;
        }
        NodeList list = root.getElementsByTagName( name );
        int n = list.getLength();
        if( n < 1 )
        {
            return null;
        }
        return (Element) list.item( 0 );
    }
1249772
public function hHtmlSimpleTagEditor($tag, $value = null, $element_id = '', $element_name = '', $context = null, $contextid = null) {        
        $html = '';
		
		switch($tag){
			case '_ACT':
				$element_id = Uuid::uuid4();
				Globals::getController()
					->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)
					->addExternalJavascript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/autocomplete.js')
					->addExternalJavascript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/updatecertificatevalues.js');
				$certificate = null;
				if($value){
					$certificate = new Certificate($value, Globals::getTree(), $this->getProvider());
				}
				$tabCities = $this->getProvider()->getCitiesList();
				$html .= '<select id="certifCity'.$element_id.'" class="_CITY">';
				foreach ($tabCities as $cities){
					$selectedCity='';
					if($certificate && $cities== $certificate->getCity()) $selectedCity='selected="true"';
					$html .= '<option value="'.$cities.'" '.$selectedCity.' />'.$cities.'</option>';
				}
				$html .= '</select>';
				$html .= '<input id="certifFile'.$element_id.'" autocomplete="off" class="_ACT" value="'.
					($certificate ? basename($certificate->getFilename()) : '').
					'" size="35" />';
				$html .= '<input type="hidden" id="'.$element_id.'" name = "'.$element_name.'" value="'.$value.'" size="35"/>';
		}
		
		return $html;
    }
370336
private Element findFirstElementByTagName(String tag, Node node) {
        if (node.nodeName().equals(tag))
            return (Element) node;
        else {
            int size = node.childNodeSize();
            for (int i = 0; i < size; i++) {
                Element found = findFirstElementByTagName(tag, node.childNode(i));
                if (found != null)
                    return found;
            }
        }
        return null;
    }
287078
public static int toModifiers(final String modifiers) {
        if (modifiers == null) {
            return 0;
        }
        final String trimmedModifiers = modifiers.trim();
        int modifier = 0;
        final StringTokenizer tok = new StringTokenizer(trimmedModifiers, " ");
        while (tok.hasMoreTokens()) {
            final String mod = tok.nextToken();
            modifier = modifier | modifierValueForName(mod);
        }
        return modifier;
    }
247063
protected function fieldToElementWithAttribute(DOMDocument $doc, string $value, $node_name): DOMElement
    {
        $item = $this->fieldToElement($doc, $value);
        $item->setAttribute($this->column_attr, (string) $node_name);

        return $item;
    }
518920
protected function getModificator()
	{
		if ( $this->modificator ) {
			list($modificator_name, $modificator_value) = each($this->modificator);
		}
		else {
			$modificator_name = $modificator_value = null;
		}

		return array($modificator_name, $modificator_value);
	}
377882
public function getElement($name)
    {
        $elements = $this->getElements();

        return isset($elements[$name]) ? $elements[$name] : null;
    }