protected function fetchSchema() {
        $columns = $this->getDb()->fetchColumnDefs($this->name);
        if ($columns === null) {
            throw new \InvalidArgumentException("Cannot fetch schema foor {$this->name}.");
        }

        $schema = [
            'type' => 'object',
            'dbtype' => 'table',
            'properties' => $columns
        ];

        $required = $this->requiredFields($columns);
        if (!empty($required)) {
            $schema['required'] = $required;
        }

        return new Schema($schema);
    }
protected function fetchSchema() {
        $columns = $this->getDb()->fetchColumnDefs($this->name);
        if ($columns === null) {
            throw new \InvalidArgumentException("Cannot fetch schema foor {$this->name}.");
        }

        $schema = [
            'type' => 'object',
            'dbtype' => 'table',
            'properties' => $columns
        ];

        $required = $this->requiredFields($columns);
        if (!empty($required)) {
            $schema['required'] = $required;
        }

        return new Schema($schema);
    }
protected function fetchSchema ( ) { $ columns = $ this -> getDb ( ) -> fetchColumnDefs ( $ this -> name ) ; if ( $ columns === null ) { throw new \ InvalidArgumentException ( "Cannot fetch schema foor {$this->name}." ) ; } $ schema = [ 'type' => 'object' , 'dbtype' => 'table' , 'properties' => $ columns ] ; $ required = $ this -> requiredFields ( $ columns ) ; if ( ! empty ( $ required ) ) { $ schema [ 'required' ] = $ required ; } return new Schema ( $ schema ) ; }
Fetch the row schema from the database meta info.

This method works fine as-is, but can also be overridden to provide more specific schema information for the model.
This method is called only once for the object and then is cached in a property so you don't need to implement
caching of your own.

If you are going to override this method we recommend you still call the parent method and add its result to your schema.
Here is an example:

```php
protected function fetchSchema() {
$schema = Schema::parse([
'body:s', // make the column required even if it isn't in the db.
'attributes:o?' // accept an object instead of string
]);

$dbSchema = parent::fetchSchema();
$schema->add($dbSchema, true);

return $schema;
}
```

@return Schema Returns the row schema.
Fetch the row schema from the database meta info .