protected function getTableMetadataRaw($name, $type, $refresh = false)
    {
        /** @var ExtendedPromiseInterface $promise */
        $promise = $this->{'loadTable' . ucfirst($type)}($name);
        if ($refresh) {
            $promise->then(function($data) use ($name, $type) {
                $this->_tableMetadata[$name] = isset($this->_tableMetadata[$name]) ? $this->_tableMetadata[$name] : [];
                $this->_tableMetadata[$name][$type] = $data;
                return $data;
            });
        }
        return $promise;
    }