public static function key($values = null) {
		$key = static::meta('key');

		if ($values === null) {
			return $key;
		}

		$self = static::_object();
		$entity = $self->_classes['entity'];
		if (is_object($values) && is_string($key)) {
			return static::_key($key, $values, $entity);
		} elseif ($values instanceof $entity) {
			$values = $values->to('array');
		}

		if (!is_array($values) && !is_array($key)) {
			return [$key => $values];
		}

		$key = (array) $key;
		$result = [];
		foreach ($key as $value) {
			if (!isset($values[$value])) {
				return null;
			}
			$result[$value] = $values[$value];
		}
		return $result;
	}
public static function key($values = null) {
		$key = static::meta('key');

		if ($values === null) {
			return $key;
		}

		$self = static::_object();
		$entity = $self->_classes['entity'];
		if (is_object($values) && is_string($key)) {
			return static::_key($key, $values, $entity);
		} elseif ($values instanceof $entity) {
			$values = $values->to('array');
		}

		if (!is_array($values) && !is_array($key)) {
			return [$key => $values];
		}

		$key = (array) $key;
		$result = [];
		foreach ($key as $value) {
			if (!isset($values[$value])) {
				return null;
			}
			$result[$value] = $values[$value];
		}
		return $result;
	}
public static function key ( $ values = null ) { $ key = static :: meta ( 'key' ) ; if ( $ values === null ) { return $ key ; } $ self = static :: _object ( ) ; $ entity = $ self -> _classes [ 'entity' ] ; if ( is_object ( $ values ) && is_string ( $ key ) ) { return static :: _key ( $ key , $ values , $ entity ) ; } elseif ( $ values instanceof $ entity ) { $ values = $ values -> to ( 'array' ) ; } if ( ! is_array ( $ values ) && ! is_array ( $ key ) ) { return [ $ key => $ values ] ; } $ key = ( array ) $ key ; $ result = [ ] ; foreach ( $ key as $ value ) { if ( ! isset ( $ values [ $ value ] ) ) { return null ; } $ result [ $ value ] = $ values [ $ value ] ; } return $ result ; }
If no values supplied, returns the name of the `Model` key. If values
are supplied, returns the key value.

@param mixed $values An array of values or object with values. If `$values` is `null`,
the meta `'key'` of the model is returned.
@return mixed Key value.
If no values supplied returns the name of the Model key . If values are supplied returns the key value .