Returns information if the collection has given element, iow. if given element exists in the collection

@param mixed $element The element to verify
@return bool
324779
public function has($element)
    {
        $index = Arrays::getIndexOf($this->elements, $element);

        return null !== $index && false !== $index;
    }
165048
public function contains( $item ) {
			
			for ( $i=0; $i < $this->len; $i++ ) {
			
				if ( $this->compare( $item, $this->items[$i] ) === 0 ) {
			
					return true;
			
				}
			
			}

			return false;
		}
545840
public function has($file)
    {
        $file = "/".ltrim($file,"/");
        foreach($this->nodes as $node) {
            $mount = $node->getMountPoint();
            if (strncmp($mount, $file, strlen($mount)) === 0) {
                $nodefile = substr($file, strlen($mount));
                if ($node->has($nodefile)) {
                    return true;
                }
            }
        }
        return false;
    }
1132645
public function hasExtension($element, $type = 'component')
    {
        $db = JFactory::getDbo();
        $sql = "SELECT `extension_id`, `state` FROM `#__extensions`"
            ." WHERE `element` = ".$db->quote($element)." AND `type` = ".$db->quote($type);

        $extension = $db->setQuery($sql)->loadObject();

        return ($extension && $extension->state != -1);
    }
167097
public function has(string $name): bool
    {
        foreach ($this->elements as $element) {
            if ($element instanceof NamedInterface && $element->getName() == $name) {
                return true;
            }
        }

        return false;
    }
42497
private function validate($element)
    {
        $violationList = $this->validator->validate($element, null, ['Generator']);
        if (0 < $violationList->count()) {
            $this->output->writeln('<error>Invalid element</error>');
            /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
            foreach ($violationList as $violation) {
                $this->output->writeln(sprintf('<error>%s : %s</error>', $violation->getPropertyPath(), $violation->getMessage()));
            }

            return false;
        }

        return true;
    }
1327224
public function hasBit(string $name) : bool
    {
        foreach ((array)$this as $element) {
            if ($element->getElement()->getValue() == $name) {
                return true;
            }
        }
        return false;
    }
413027
private function extractImg(Element $element){
        if($element instanceof Container){
            foreach($element->getElements('oat\taoQtiItem\model\qti\Img') as $img){
                $this->addAsset('img', $img->attr('src'));
            }
        }
    }
1117879
public function has($keys)
    {
        $keys = (array) $keys;
        if (!$this->elements || $keys === []) {
            return false;
        }
        foreach ($keys as $key) {
            $items = $this->elements;
            if ($this->exists($items, $key)) {
                continue;
            }
            foreach (explode('.', $key) as $segment) {
                if (!is_array($items) || !$this->exists($items, $segment)) {
                    return false;
                }
                $items = $items[$segment];
            }
        }
        return true;
    }
1192249
public function hasElement( $name, $prefix = null )
	{
		return isset( $this->elements[ is_null( $prefix ) ? $name : "$prefix:$name" ] );
	}
397968
public function remove($element)
    {
        $index = $this->indexOf($element);

        if ($index !== false) {
            unset($this->_items[$index]);
            $this->_items = array_values($this->_items);
            $this->_iterator = null;
            return true;
        }
        return false;
    }
753906
public function detectNamespacesFromSimpleXmlElement( $element )
	{
		$namespaces	= self::getNamespacesFromSimpleXmlElement( $element );
		$this->namespaces	= array_merge( $this->namespaces, $namespaces );
		return count( $namespaces );
	}
1188602
protected function isValidationNeeded(\marvin255\serviform\interfaces\Field $element, $elements)
    {
        return
            (
                !$this->getSkipOnError()
                || !$element->getErrors()
            ) && (
                !$this->getSkipOnEmpty()
                || !$this->isEmpty($element->getValue())
            ) && (
                !is_callable($this->getWhen())
                || call_user_func_array($this->getWhen(), [$this, $element])
            ) && (
                empty($elements) || in_array($element->getName(), $elements)
            );
    }
1194033
public function beforeElementSave (ElementInterface $element, bool $isNew): bool
	{
		if (!SimpleMap::getInstance()->map->validateField($this, $element))
			return false;

		return parent::beforeElementSave($element, $isNew);
	}
270355
private function getValueKeyFromObject($element, $key)
    {
        if (!$element instanceof \stdClass) {
            $getterName = 'get'.str_replace(' ', '', ucwords($key));

            return (method_exists($element, $getterName)) ? $element->$getterName() : false;
        }

        return (isset($element->{$key})) ? $element->{$key} : false;
    }
807760
function &getElement($element)
    {
        if (isset($this->_elementIndex[$element])) {
            return $this->_elements[$this->_elementIndex[$element]];
        } else {
            $error = self::raiseError(null, QUICKFORM_NONEXIST_ELEMENT, null, E_USER_WARNING, "Element '$element' does not exist in HTML_QuickForm::getElement()", 'HTML_QuickForm_Error', true);
            return $error;
        }
    }
1169274
function get($element) {
        $node = $this->findNode($element, $this->root);

        assert($node != null);

        return $node->value();
    }