public function setId($id)
    {
        if (!is_scalar($id)) {
            throw new InvalidArgumentException(sprintf(
                'ID for "%s" must be a scalar (integer, float, string, or boolean); received %s',
                get_class($this),
                (is_object($id) ? get_class($id) : gettype($id))
            ));
        }

        $key = $this->key();
        if ($key === 'id') {
            $this->id = $id;
        } else {
            $this[$key] = $id;
        }

        return $this;
    }