MadelineProto/src/danog/MadelineProto/Db/MemoryArray.php

19 lines
481 B
PHP
Raw Normal View History

2020-04-25 21:57:55 +02:00
<?php
namespace danog\MadelineProto\Db;
2020-04-27 02:21:18 +02:00
class MemoryArray extends \ArrayIterator implements DbArray
2020-04-25 21:57:55 +02:00
{
2020-04-27 02:21:18 +02:00
protected function __construct($array = [], $flags = 0)
{
parent::__construct((array) $array, $flags | self::STD_PROP_LIST);
}
2020-04-25 21:57:55 +02:00
static function getInstance(array $settings, string $name, $value = []): DbArray
{
if ($value instanceof DbArray) {
$value = $value->getArrayCopy();
}
return new static($value);
}
}