_exists($this->getChannel($channel)); } abstract function _reset(CapacitorChannel $channel): void; /** supprimer le canal spécifié */ function reset(?string $channel): void { $this->_reset($this->getChannel($channel)); } abstract function _charge(CapacitorChannel $channel, $item, ?callable $func, ?array $args): bool; /** * charger une valeur dans le canal * * Si $func!==null, après avoir calculé les valeurs des clés supplémentaires * avec {@link CapacitorChannel::getKeyValues()}, la fonction est appelée avec * les arguments ($item, $keyValues, $row, ...$args) * Si la fonction retourne un tableau, il est utilisé pour modifié les valeurs * insérées/mises à jour * * @return true si l'objet a été chargé ou mis à jour, false s'il existait * déjà à l'identique dans le canal */ function charge(?string $channel, $item, ?callable $func=null, ?array $args=null): bool { return $this->_charge($this->getChannel($channel), $item, $func, $args); } abstract function _discharge(CapacitorChannel $channel, $filter, ?bool $reset): iterable; /** décharger les données du canal spécifié */ function discharge(?string $channel, $filter=null, ?bool $reset=null): iterable { return $this->_discharge($this->getChannel($channel), $filter, $reset); } abstract function _get(CapacitorChannel $channel, $filter); /** * obtenir l'élément identifié par les clés spécifiées sur le canal spécifié * * si $filter n'est pas un tableau, il est transformé en ["_id" => $filter] */ function get(?string $channel, $filter) { return $this->_get($this->getChannel($channel), $filter); } abstract function _each(CapacitorChannel $channel, $filter, callable $func, ?array $args): void; /** * appeler une fonction pour chaque élément du canal spécifié. * * $filter permet de filtrer parmi les élements chargés * * si $func retourne un tableau, il est utilisé pour mettre à jour * l'enregistrement. */ function each(?string $channel, $filter, callable $func, ?array $args=null): void { $this->_each($this->getChannel($channel), $filter, $func, $args); } abstract function close(): void; }