MadelineProtoDocs/docs/PHP/danog/MadelineProto/Settings/Database/DatabaseAbstract.md

128 lines
2.2 KiB
Markdown
Raw Normal View History

2020-10-15 18:42:54 +02:00
---
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 <daniil@daniil.it>
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.
2020-10-15 19:11:10 +02:00
---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
2020-10-15 18:42:54 +02:00
### `getCacheTtl(): int`
Get for how long to keep records in memory after last read, for cached backends.
2020-10-15 19:11:10 +02:00
---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
2020-10-15 18:42:54 +02:00
### `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.
2020-10-15 19:11:10 +02:00
---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
2020-10-15 18:42:54 +02:00
### `getPassword(): string`
Get password.
2020-10-15 19:11:10 +02:00
---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
2020-10-15 18:42:54 +02:00
### `setPassword(string $password): self`
Set password.
Parameters:
* `$password`: `string` Password.
2020-10-15 19:11:10 +02:00
---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
2020-10-15 18:42:54 +02:00
### `getDatabase(): string|int`
Get database name/ID.
2020-10-15 19:11:10 +02:00
---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
2020-10-15 18:42:54 +02:00
### `getUri(): string`
Get database URI.
2020-10-15 19:11:10 +02:00
---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
2020-10-15 18:42:54 +02:00
### `setDatabase(int|string $database): self`
Set database name/ID.
Parameters:
* `$database`: `int|string`
2020-10-15 19:11:10 +02:00
---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
2020-10-15 18:42:54 +02:00
### `setUri(string $uri): self`
Set database URI.
Parameters:
* `$uri`: `string`
2020-10-15 19:11:10 +02:00
---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
2020-10-15 18:42:54 +02:00
### `hasChanged(): bool`
Get whether this setting was changed, also applies changes.
2020-10-15 19:11:10 +02:00
---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
2020-10-15 18:42:54 +02:00
2020-10-15 19:11:10 +02:00
---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)