2023-08-13 11:40:35 +02:00
|
|
|
<?php declare(strict_types=1);
|
2022-12-30 21:54:44 +01:00
|
|
|
|
2023-08-13 11:40:35 +02:00
|
|
|
/**
|
|
|
|
* This file is part of MadelineProto.
|
|
|
|
* MadelineProto is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
* MadelineProto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU Affero General Public License for more details.
|
|
|
|
* You should have received a copy of the GNU General Public License along with MadelineProto.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* @author Daniil Gentili <daniil@daniil.it>
|
|
|
|
* @copyright 2016-2023 Daniil Gentili <daniil@daniil.it>
|
|
|
|
* @license https://opensource.org/licenses/AGPL-3.0 AGPLv3
|
|
|
|
* @link https://docs.madelineproto.xyz MadelineProto documentation
|
|
|
|
*/
|
2020-04-25 21:57:55 +02:00
|
|
|
|
|
|
|
namespace danog\MadelineProto\Db;
|
|
|
|
|
2022-12-30 19:21:36 +01:00
|
|
|
use ArrayAccess;
|
2020-04-28 02:41:06 +02:00
|
|
|
|
2020-10-03 15:04:35 +02:00
|
|
|
/**
|
|
|
|
* DB array interface.
|
|
|
|
*
|
2023-01-19 17:14:04 +01:00
|
|
|
* @template TKey as array-key
|
|
|
|
* @template TValue
|
|
|
|
*
|
|
|
|
* @extends ArrayAccess<TKey, TValue>
|
2023-08-13 15:47:21 +02:00
|
|
|
* @extends DbType<TKey, TValue>
|
2020-10-03 15:04:35 +02:00
|
|
|
*/
|
2023-08-13 15:47:21 +02:00
|
|
|
interface DbArray extends DbType, ArrayAccess
|
2020-04-25 21:57:55 +02:00
|
|
|
{
|
2020-10-03 15:04:35 +02:00
|
|
|
/**
|
|
|
|
* Set element.
|
|
|
|
*
|
2023-01-25 16:32:48 +01:00
|
|
|
* @param TKey $index
|
|
|
|
* @param TValue $value
|
2020-10-03 15:04:35 +02:00
|
|
|
*/
|
2022-12-30 19:21:36 +01:00
|
|
|
public function offsetSet(mixed $index, mixed $value): void;
|
2020-10-03 15:04:35 +02:00
|
|
|
/**
|
|
|
|
* Unset element.
|
2023-01-25 16:32:48 +01:00
|
|
|
* @param TKey $index Offset
|
2021-12-06 20:20:43 +01:00
|
|
|
*/
|
|
|
|
public function offsetUnset(mixed $index): void;
|
|
|
|
/**
|
|
|
|
* @see DbArray::isset();
|
2023-01-25 16:32:48 +01:00
|
|
|
*
|
|
|
|
* @param TKey $index Offset
|
2020-10-03 15:04:35 +02:00
|
|
|
*/
|
2021-12-06 20:20:43 +01:00
|
|
|
public function offsetExists(mixed $index): bool;
|
2020-11-26 21:49:31 +01:00
|
|
|
/**
|
2023-08-13 15:47:21 +02:00
|
|
|
* Get Array copy.
|
2020-10-03 15:04:35 +02:00
|
|
|
*
|
2023-08-13 15:47:21 +02:00
|
|
|
* @psalm-return array<TKey, TValue>
|
2020-10-03 15:04:35 +02:00
|
|
|
*/
|
2023-08-13 15:47:21 +02:00
|
|
|
public function getArrayCopy(): array;
|
2020-06-16 17:52:55 +02:00
|
|
|
}
|