@param string $key
@param array  $options

@return bool
970349
private static function haveOptionsBeenUpdated($key, array $options = [])
    {
        if (array_key_exists($key, self::$cache)) {
            return (self::$cache[$key] != $options);
        }
        return false;
    }
859976
public function save($table, $data, $keys, $options = []) {
		return $this->object->save($table, $data, $keys, $options);
	}
1007495
public function delete($key, array $options = []) {
		$cookieClass = get_called_class();

		return function($params) use ($cookieClass) {
			$key = $params['key'];
			$path = '/' . str_replace('.', '/', $this->_config['name'] . '.' . $key) . '/.';
			$cookies = current(Set::extract($_COOKIE, $path));
			if (is_array($cookies)) {
				$cookies = array_keys(Set::flatten($cookies));
				foreach ($cookies as &$name) {
					$name = $key . '.' . $name;
				}
			} else {
				$cookies = [$key];
			}
			foreach ($cookies as &$name) {
				$result = setcookie(
					$cookieClass::keyFormat($name, $this->_config),
					"",
					1,
					$this->_config['path'],
					$this->_config['domain'],
					$this->_config['secure'],
					$this->_config['httponly']
				);
				if (!$result) {
					throw new RuntimeException("There was an error deleting {$name} cookie.");
				}
			}
			return true;
		};
	}
788664
protected function parseData($data, array $options, $key = null)
    {
        $architect = new Architect();

        return $architect->parseData($data, $options['modes'], $key);
    }
808738
public function dump($Key, $Variable, $Options = array())
    {
        if (!is_string($Key)) {
            throw $this->newException('Key passed to dump() is not a string');
        }
        if (strlen($Key)>100) {
            throw $this->newException('Key passed to dump() is longer than 100 characters');
        }
        if (!preg_match_all('/^[a-zA-Z0-9-_\.:]*$/', $Key, $m)) {
            throw $this->newException('Key passed to dump() contains invalid characters [a-zA-Z0-9-_\.:]');
        }
        return $this->fb($Variable, $Key, FirePHP::DUMP, $Options);
    }
823633
public static function getArray(
        array $options,
        string $key,
        $default = null
    ) {
        if (array_key_exists($key, $options)) {
            return (array)$options[$key];
        }

        return $default;
    }
1311492
public static function show($key = null, $options = [])
    {
        $output = self::getStats($key, $options);

        if (!empty($output)) {
            self::output($output);
        }
    }
974093
public function purgeKey($service, $key, array $options = [])
    {
        $url = '/service/' . urlencode($service) . '/purge/' . $key;

        return $this->send('POST', $url, $options);
    }
993938
public function updateOrCreateNew(array $attributes, $key, array $options = []) : Model
    {
        $query = $this->newQuery();

        if (is_array($key)) {
            foreach ($key as $column) {
                $query->where($column, $attributes[$column]);
            }
        } else {
            $query->where($key, $attributes[$key]);
        }

        /** @var Model|Model $row */
        $row = $query->first();

        if ($row !== null) {
            $row->updateExisting(array_replace($row->getAttributes(), $attributes));

            return $row;
        }

        return $this->fillSave($attributes, $options);
    }
412491
public function key( $key = '', $is_option = false ) {
		return $this->get_key( $this->validate_length( $key ), $is_option );
	}
88463
function unique($key, $options = \SORT_REGULAR) {
        if($key === null) {
            return (new self(\array_unique($this->data, $options)));
        }
        
        $exists = array();
        return $this->filter(function ($item) use ($key, &$exists) {
            if(\is_array($item)) {
                if(!isset($item[$key])) {
                    throw new \BadMethodCallException('Specified key "'.$key.'" does not exist on array');
                }
                
                $id = $item[$key];
            } elseif(\is_object($item)) {
                if(!isset($item->$key)) {
                    throw new \BadMethodCallException('Specified key "'.$key.'" does not exist on object');
                }
                
                $id = $item->$key;
            } else {
                $id = $item;
            }
            
            if(\in_array($id, $exists, true)) {
                return false;
            }
            
            $exists[] = $id;
            return true;
        });
    }
966547
public static function get(
        array $options,
        string $key,
        $default = null
    ) {
        if (array_key_exists($key, $options)) {
            return $options[$key];
        }

        return $default;
    }
677220
public function setOptionsArray($options) {
    foreach($options as $key => $value) {
      if (!$this->setOption($key, $value)) {
        return false;
      }
    }
    return true;
  }
598268
protected function assertRequiredOptions($key, array $options)
    {
        $missing = array_diff_key(array_flip($this->getRequiredOptions($key)), $options);
        if (!empty($missing)) {
            throw new \InvalidArgumentException(
                '参数不完整，请指定'.$key.'参数: '.implode(', ', array_keys($missing))
            );
        }
    }
905121
protected function _validateOption($key)
    {
        switch ($key) {
            case self::OPTION_SEARCH_TYPE:
            case self::OPTION_ROUTING:
            case self::OPTION_PREFERENCE:
            case self::OPTION_VERSION:
            case self::OPTION_TIMEOUT:
            case self::OPTION_FROM:
            case self::OPTION_SIZE:
            case self::OPTION_SCROLL:
            case self::OPTION_SCROLL_ID:
            case self::OPTION_SEARCH_TYPE_SUGGEST:
            case self::OPTION_SEARCH_IGNORE_UNAVAILABLE:
            case self::OPTION_QUERY_CACHE:
            case self::OPTION_TERMINATE_AFTER:
            case self::OPTION_SHARD_REQUEST_CACHE:
            case self::OPTION_FILTER_PATH:
            case self::OPTION_TYPED_KEYS:
                return true;
        }

        throw new InvalidException('Invalid option '.$key);
    }
201589
public function query($sql, $key = null, $options = []) {
		return $this->object->query($sql, $key, $options);
	}
28728
public function hasOptions(array $options) {
        $all = true;

        foreach ($options as $option) {
            if (!isset($this->_options[$option])) {
                $all = false;
            }
        }

        return $all;
    }