Access Controls, Bridges, Call Block, Call Flows: Class toggle method adjustments.

This commit is contained in:
Nate
2019-10-29 10:11:18 -06:00
parent 90e6ad93e7
commit f99005427c
4 changed files with 19 additions and 15 deletions

View File

@@ -18,6 +18,7 @@ if (!class_exists('call_flows')) {
private $table;
private $uuid_prefix;
private $toggle_field;
private $toggle_values;
/**
* called when the object is created
@@ -32,6 +33,7 @@ if (!class_exists('call_flows')) {
$this->table = 'call_flows';
$this->uuid_prefix = 'call_flow_';
$this->toggle_field = 'call_flow_status';
$this->toggle_values = ['true','false'];
}
@@ -138,7 +140,7 @@ if (!class_exists('call_flows')) {
$x = 0;
foreach($states as $uuid => $state) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
$array[$this->table][$x][$this->toggle_field] = $state == 'true' ? 'false' : 'true';
$array[$this->table][$x][$this->toggle_field] = $state == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
$x++;
}