function get_table_from_class($class) { $table = get_class_variable($class, "__table"); if (!$table) { return $class; } return $table; }
function fix_syncserver_nname_problem() { $rewrite = get_class_variable($this->get__table(), "__rewrite_nname_const"); if ($rewrite && array_search_bool("syncserver", $rewrite)) { $newthis = clone $this; $newthis->syncserver = $newserver; foreach ($rewrite as $n) { $nnamelist[] = $newthis->{$n}; } $newthis->nname = implode($sgbl->__var_nname_impstr, $nnamelist); $sql = new Sqlite($this->__masterserver, $this->get__table()); $res = $sql->getRowsWhere("nname = '{$newthis->nname}'"); if ($res) { throw new lxException("changed_name_already_exists", $newthis->nname, "syncserver"); } $this->__real_nname = $this->nname; $this->nname = $newthis->nname; $parent = $this->getParentO(); $list = $this->get__table() . "_l"; $parent->{$list}[$this->__real_nname] = null; unset($parent->{$list}[$this->__real_nname]); $parent->{$list}[$this->nname] = $this; } }