dbmsv4 init...3
This commit is contained in:
parent
a62bb3a80d
commit
a88fb96bd3
@ -121,13 +121,18 @@ abstract class BaseSource extends DBMigration
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// final public function switchcode(): void
|
||||||
|
// {
|
||||||
|
// $this->execute(
|
||||||
|
// new SWITCHCodeProcess($this->getTargetDB()),
|
||||||
|
// $this->getSWITCHCode(),
|
||||||
|
// __FUNCTION__,
|
||||||
|
// $this->getDBName()
|
||||||
|
// );
|
||||||
|
// }
|
||||||
final public function switchcode(): void
|
final public function switchcode(): void
|
||||||
{
|
{
|
||||||
$this->execute(
|
$processor = new SWITCHCodeProcess($this->getTargetDB());
|
||||||
new SWITCHCodeProcess($this->getTargetDB()),
|
$processor->make();
|
||||||
$this->getSWITCHCode(),
|
|
||||||
__FUNCTION__,
|
|
||||||
$this->getDBName()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,14 +11,19 @@ class SwitchCodeProcess implements MigrationProcessInterface
|
|||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
public function process(string $site, array $row, int $cnt): void
|
public function process(string $site, array $row, int $cnt): void {}
|
||||||
|
public function make(): void
|
||||||
{
|
{
|
||||||
$temps = [];
|
for ($i = 1; $i <= 88; $i++) {
|
||||||
$temps['code'] = trim($row['service_sw']);
|
for ($j = 1; $j <= 48; $j++) {
|
||||||
$temps['status'] = STATUS['AVAILABLE']; // Assuming SWITCHEntity has a STATUS_DEFAULT constant
|
$temps = [];
|
||||||
if (!$this->db->table('switchinfo')->insert($temps)) {
|
$temps['code'] = sprintf("C%02dPA%02d", $i, $j);
|
||||||
throw new \Exception($this->db->error()['message']);
|
$temps['status'] = STATUS['AVAILABLE'];
|
||||||
|
if (!$this->db->table('switchinfo')->insert($temps)) {
|
||||||
|
throw new \Exception($this->db->error()['message']);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
echo "{$cnt} -> {$temps['code']} SWITCHCODE 완료.\n";
|
echo "SWITCHCODE 완료.\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user