Check the set of items to have an item with the given key set to a
truthy value.
@param  array  $items array of item data
@param  string $key   array key to check
@return bool true if any item has a truthy value at the given key
163479
protected function _anyItem($items, $key)
    {
        foreach ($items as $item) {
            if (isset($item[$key]) && $item[$key]) {
                return true;
            }
        }
        return false;
    }
41929
protected function hasArrayKey(array $array, array $keys): bool
    {
        foreach ($keys as $key) {
            if (array_key_exists($key, $array)) {
                return true;
            }
        }

        return false;
    }
1309368
public function has_file( $key ) {
		$files = $this->file( $key );

		if ( ! is_array( $files ) ) {
			$files = [ $files ];
		}

		foreach ( $files as $file ) {
			if ( $this->is_valid_file( $file ) ) {
				return true;
			}
		}

		return false;
	}
507489
protected function sortItems(array $items, string $key = 'order'): array
    {
        $cmp = function (&$a, &$b) use (&$cmp, $key) {
            if (!empty($a['children'])) {
                usort($a['children'], $cmp);
            }

            if (!empty($b['children'])) {
                usort($b['children'], $cmp);
            }

            return $a[$key] > $b[$key];
        };

        usort($items, $cmp);

        return $items;
    }
684981
public function hasFile($key)
    {
        if (! is_array($files = $this->file($key))) {
            $files = [$files];
        }

        foreach ($files as $file) {
            if ($this->isValidFile($file)) {
                return true;
            }
        }

        return false;
    }
1132382
public static function has($data, $key)
    {
        if (self::isArrayAccess($data)) {
            return array_key_exists($key, $data);
        }
        if (!is_object($data)) {
            return false;
        }
        if (method_exists($data, 'get' . $key)) {
            return true;
        }
        if (method_exists($data, 'get' . str_replace('_', '', $key))) {
            return true;
        }
        if (isset($data->$key)) {
            return true;
        }

        return false;
    }
213703
protected function hasItem($key, $type)
	{
		if(array_key_exists($type, $this->storage) && array_key_exists($key, $this->storage[$type]))
		{
			return true;
		}

		return false;
	}
1345725
public function setItems(array $items)
    {
        $cont = 0;
        $fItems = [];
        foreach ($items as $item) {
            $cont++;

            $fItems = array_merge($fItems, [
              'itemId'.$cont          => $this->sanitize($item, 'itemId'),
              'itemDescription'.$cont => $this->sanitize($item, 'itemDescription'),
              'itemAmount'.$cont      => $this->sanitizeMoney($item, 'itemAmount'),
              'itemQuantity'.$cont    => $this->sanitizeNumber($item, 'itemQuantity'),
            ]);
        }

        $this->itemsCount = $cont;
        $this->validateItems($fItems);
        $this->items = $fItems;

        return $this;
    }
1258059
public function has($key)
    {
        $array = $this->data;
        foreach (explode(self::SEPERATOR, $key) as $item) {
            if (is_array($array) && array_key_exists($item, $array)) {
                $array = $array[$item];
            } else {
                return false;
            }
        }

        return true;
    }
383191
public function hasValue($data, $keys)
    {
        if ($this->isKeysEmpty($keys)) {
            return true;
        }
        if (!is_array($keys)) {
            $keys = [$keys];
        }

        $accessor = new Accessor($data);
        $keyCount = count($keys);
        $depth    = 0;
        foreach ($keys as $key) {
            if (($depth + 1 === $keyCount && $accessor->has($key) === false) || $accessor->to($key) === false) {
                return false;
            }

            ++$depth;
        }

        return true;
    }
753278
public static function has(array $storage, $key)
    {
        $keys	= explode('.', $key);

        foreach($keys as $key)
        {
            if(!isset($storage[$key]))
                return false;

            $storage	= $storage[$key];
        }

        return true;
    }
165895
public function has($key)
    {
        $keys = is_array($key) ? $key : func_get_args();

        $input = $this->all();

        foreach ($keys as $value) {
            if (! Arr::has($input, $value)) {
                return false;
            }
        }

        return true;
    }
216478
private function validateKeys(array $keys)
    {
        foreach ($keys as $key) {
            $key = (string)$key;
            $this->validateKey($key);
        }
    }
564323
protected function isArrayHasKeys($array = [], $keys = []) {
		foreach ($keys as $key) {
			if (!ArrayHelper::getValue($array, $key, false)) {
				return false;
			}
		}

		return true;
	}
1339046
public function hasQuery($key)
    {
        $arrayKeys = array_keys($_GET);
        $keys = is_array($key) ? $key : func_get_args();

        foreach ($keys as $value) {
            if (!in_array($value, $arrayKeys) || trim((string)$_GET[$value]) === '') {
                return false;
            }
        }

        return true;
    }
720766
public function has($key)
    {
        // For performance, we can use isset,
        // but it will not match if value == 0
        return isset($this->values[$key]) || array_key_exists($key, $this->values);
    }
1049708
public function deleteItems(array $keys): bool
    {
        foreach ($keys as $key) {
            $this->delete($key);
        }

        return true;
    }