M1\Vars\Resource\AbstractResource::arrayKeyExists PHP Method

arrayKeyExists() public method

Port of array_key_exists to \ArrayAccess
public arrayKeyExists ( mixed $key ) : boolean
$key mixed The key to check if exists
return boolean Does the key exist
    public function arrayKeyExists($key)
    {
        if (array_key_exists($key, $this->content)) {
            return true;
        }
        $parts = explode('.', $key);
        $arr = $this->content;
        foreach ($parts as $part) {
            if (!is_array($arr) || !array_key_exists($part, $arr)) {
                return false;
            }
            $arr = $arr[$part];
        }
        return true;
    }