Check existence of specific type of data from specific key from response.

@param string $type
@param string $key

@return mixed
972309
private function hasData($type, $key)
    {
        return isset($this->data[$type]) && isset($this->data[$type][$key]);
    }
317560
public function getMessage($type = null, $key = 'messages')
    {
        if (isset($type)) {
            $key .= ".$type";
        }

        $message = $this->get($key, array());
        $this->delete($key);
        return $message;
    }
1306006
protected static function _cache($type, $key, $value = false)
    {
        $key = '_' . $key;
        $type = '_' . $type;
        if ($value !== false) {
            self::$_cache[$type][$key] = $value;
            return $value;
        }
        if (!isset(self::$_cache[$type][$key])) {
            return false;
        }
        return self::$_cache[$type][$key];
    }
635966
public function has($key)
    {
        return isset($this->data[$key]) && is_array($this->data[$key]);
    }
126954
public static function get($key = null, $type = 'string', $defaultValue = '')
    {
        if (!$key) {
            return $_GET;
        }
        return self::typeConvert(isset($_GET[$key]) ? $_GET[$key] : $defaultValue, $type);
    }
1182092
public function getElementsWhichUseField($key, $type = "tt_content")
    {
        $storage = $this->storageRepository->load();

        $elementsInUse = array();
        if ($storage[$type]["elements"]) {
            foreach ($storage[$type]["elements"] as $element) {
                if ($element["columns"]) {
                    foreach ($element["columns"] as $column) {
                        if ($column == $key) {
                            $elementsInUse[] = $element;
                        }
                    }
                }
            }
        }
        return $elementsInUse;
    }
309671
private function canKeyBeUsedFor($type, JWKInterface $key)
    {
        if ($key->has('use')) {
            return $type === $key->get('use') ? 1 : false;
        }
        if ($key->has('key_ops')) {
            return $type === self::convertKeyOpsToKeyUse($key->get('use')) ? 1 : false;
        }

        return 0;
    }
519465
public function searchPartByKeyAndType($key, $type = '\\Zepi\\Web\\UserInterface\\Layout\\AbstractContainer')
    {
        foreach ($this->parts as $part) {
            if ((is_a($part, $type) || is_subclass_of($part, $type)) && $part->getKey() === $key) {
                return $part;
            }
            
            $result = $part->searchPartByKeyAndType($key, $type);
            if ($result !== false) {
                return $result;
            }
        }
        
        return false;
    }
116498
private function isOpType($type, $key)
    {
        if (!isset($this->ops[$type])) {
            return false;
        }
        return in_array($key, $this->ops[$type]);
    }
27776
public function post($key)
    {
        if ($this->has('post') && isset($this->data['post'][$key]) === true) {
            return $this->data['post'][$key];
        }
        return $key;
    }
1160304
protected function _normalize($key, $type)
    {
        $type = strtolower($type);

        if ($type !== 'external' && $type !== 'internal')
            throw new \InvalidArgumentException;

        if ($type === 'external')
            $return = $this->_normalizeExternal($key);
        else
            $return = $this->_normalizeInternal($key);

        return $return;
    }
696322
protected function findData($key)
    {
        $criteria = Criteria::create()
            ->where(Criteria::expr()->eq('key', $key));

        $result = $this->data->matching($criteria);

        if (is_array($result)) {
            $result = reset($result);

            return $result;
        }
    }
41976
public function get(string $type = '', string $module = '', $key = null) {
		$result = $this->data;
		if (!empty($type)) {
			$result = $result[$type] ?? null;
			if (!isset($result)) return $result;
			if (!empty($module)) {
				$result = $result[$module] ?? null;
				if (!isset($result)) return $result;
				if (!empty($key)) {
					$result = $result[$key] ?? null;
					if (!isset($result)) return $result;
				} else if (!empty($result['datasource'])) {
					// acl is skipped intentionally
					return \Factory::model($result['datasource'], true)->get(['skip_acl' => true]);
				}
			}
		}
		return $result;
	}
85473
public function type($key)
	{
		if (Str::endsWith($key, ':queued')) {
			$key = str_replace(':queued', '', $key);
		}

		return $this->database->type($key);
	}
353951
public function getDatatype($key)
    {

        $validation = $this->getValidation($key);

        if(empty($validation['datatype']))
            throw new Exception('No datatype defined for key: '.$key);

        return $validation['datatype'];
    }
1316433
public function has($key) {
		$this->check();
		$data = $this->readData();
		return isset($data[$key]);
	}
972765
protected function checkKeyExists($data, $key)
    {
        if (!$data->has($key)) {
            $this->output->writeln("<error>The key $key does not exist.");

            return false;
        }

        return true;
    }