--- title: danog\MadelineProto\Settings\Database\DatabaseAbstract: Base class for database backends. description: --- # `danog\MadelineProto\Settings\Database\DatabaseAbstract` [Back to index](../../../../index.md) > Author: Daniil Gentili Base class for database backends. ## Method list: * `getKey(): string` * `getCacheTtl(): int` * `setCacheTtl(int|string $cacheTtl): self` * `getPassword(): string` * `setPassword(string $password): self` * `getDatabase(): string|int` * `getUri(): string` * `setDatabase(int|string $database): self` * `setUri(string $uri): self` * `hasChanged(): bool` ## Methods: ### `getKey(): string` Get DB key. --- Generated by [danog/phpdoc](https://phpdoc.daniil.it) ### `getCacheTtl(): int` Get for how long to keep records in memory after last read, for cached backends. --- Generated by [danog/phpdoc](https://phpdoc.daniil.it) ### `setCacheTtl(int|string $cacheTtl): self` Set for how long to keep records in memory after last read, for cached backends. The cache TTL identifier can be a string like '+5 minutes'. Parameters: * `$cacheTtl`: `int|string` For how long to keep records in memory after last read, for cached backends. --- Generated by [danog/phpdoc](https://phpdoc.daniil.it) ### `getPassword(): string` Get password. --- Generated by [danog/phpdoc](https://phpdoc.daniil.it) ### `setPassword(string $password): self` Set password. Parameters: * `$password`: `string` Password. --- Generated by [danog/phpdoc](https://phpdoc.daniil.it) ### `getDatabase(): string|int` Get database name/ID. --- Generated by [danog/phpdoc](https://phpdoc.daniil.it) ### `getUri(): string` Get database URI. --- Generated by [danog/phpdoc](https://phpdoc.daniil.it) ### `setDatabase(int|string $database): self` Set database name/ID. Parameters: * `$database`: `int|string` --- Generated by [danog/phpdoc](https://phpdoc.daniil.it) ### `setUri(string $uri): self` Set database URI. Parameters: * `$uri`: `string` --- Generated by [danog/phpdoc](https://phpdoc.daniil.it) ### `hasChanged(): bool` Get whether this setting was changed, also applies changes. --- Generated by [danog/phpdoc](https://phpdoc.daniil.it) --- Generated by [danog/phpdoc](https://phpdoc.daniil.it)