protected function getSchemaMetadata($schema, $type, $refresh)
    {
        $metadata = [];
        $methodName = 'getTable' . ucfirst($type);
        foreach ($this->getTableNames($schema, $refresh) as $name) {
            if ($schema !== '') {
                $name = $schema . '.' . $name;
            }
            $tableMetadata = $this->$methodName($name, $refresh);
            if ($tableMetadata !== null) {
                $metadata[] = $tableMetadata;
            }
        }

        return $metadata;
    }
protected function getSchemaMetadata($schema, $type, $refresh)
    {
        $metadata = [];
        $methodName = 'getTable' . ucfirst($type);
        foreach ($this->getTableNames($schema, $refresh) as $name) {
            if ($schema !== '') {
                $name = $schema . '.' . $name;
            }
            $tableMetadata = $this->$methodName($name, $refresh);
            if ($tableMetadata !== null) {
                $metadata[] = $tableMetadata;
            }
        }

        return $metadata;
    }
Returns the metadata of the given type for all tables in the given schema.
This method will call a `'getTable' . ucfirst($type)` named method with the table name
and the refresh flag to obtain the metadata.
@param string $schema the schema of the metadata. Defaults to empty string, meaning the current or default schema name.
@param string $type metadata type.
@param bool $refresh whether to fetch the latest available table metadata. If this is `false`,
cached data may be returned if available.
@return array array of metadata.
@since 2.0.13