nulib/php/tests/db/sqlite/impl/MyChannel.php

34 lines
719 B
PHP

<?php
namespace nulib\db\sqlite\impl;
use nulib\db\CapacitorChannel;
class MyChannel extends CapacitorChannel {
const NAME = "my";
const TABLE_NAME = "my";
const COLUMN_DEFINITIONS = [
"name" => "varchar not null primary key",
"value" => "varchar",
];
const VERSION = 1;
function __construct() {
parent::__construct();
$this->version = static::VERSION;
}
protected int $version;
function getItemValues($item): ?array {
return [
"name" => "{$item["name"]}$this->version",
"value" => "{$item["value"]} v$this->version",
"date_cre" => $item["date_cre"] ?? null,
"date_mod" => $item["date_mod"] ?? null,
"age" => $item["age"] ?? null,
];
}
}