nur-sery/nur_src/mapper/base/capacitor/TCapacitor.php

18 lines
569 B
PHP
Raw Normal View History

2024-04-04 16:26:22 +04:00
<?php
namespace nur\mapper\base\capacitor;
use nur\b\IllegalAccessException;
trait TCapacitor {
function chargeAll(iterable $items, ?string $channel=null): void {
foreach ($items as $item) {
$this->charge($item, $channel);
}
}
function offsetExists($offset) { throw IllegalAccessException::not_implemented(); }
function offsetGet($offset) { throw IllegalAccessException::not_implemented(); }
function offsetUnset($offset) { throw IllegalAccessException::not_implemented(); }
function offsetSet($offset, $value) { $this->charge($value); }
}