private function delCurrentAccount unset this- accounts this- selected

1
2
3
4
5
6
7
private function delCurrentAccount() {
unset($this->accounts[$this->selected_account]);
$this->accounts = array_values($this->accounts);
$this->selected_account = array_key_exists($this->selected_account, $this->accounts) ? $this->selected_account : array_key_exists($this->selected_account - 1, $this->accounts) ? $this->selected_account - 1 : 'err';
if($this->selected_account == 'err')
$this->toLog('Закончились аккаунты для работы!', self::ERROR);
}