| | |
| | | |
| | | /** |
| | | * Nazwa modułu, którego zmienne klasa przetwarza |
| | | * @var string max. 40 znaków |
| | | * @var string max. 40 znaków |
| | | */ |
| | | var $class; |
| | | |
| | |
| | | } |
| | | |
| | | private function init() { |
| | | if(strlen($this->class) == 0) { |
| | | throw new Exception('Przed użyciem $msg->session należy ustawić nazwę modułu za pomocą metody setClass - patrz "Poradnik tworzenia modułów", dział "Klasa BotMessage", rozdział "Pole $session".'); |
| | | } |
| | | |
| | | if($this->PDO) { |
| | | return NULL; |
| | | } |
| | |
| | | ); |
| | | |
| | | $files = glob(BOT_TOPDIR.'/db/*/'.$this->user_struct['user'].'.ggdb'); |
| | | if(!$files) { |
| | | return; |
| | | } |
| | | |
| | | $this->PDO->beginTransaction(); |
| | | $st = $this->PDO->prepare('INSERT OR REPLACE INTO data (class, name, value) VALUES (?, ?, ?)'); |
| | |
| | | return $return; |
| | | } |
| | | |
| | | function setClass($class) { |
| | | $this->class = $class; |
| | | } |
| | | |
| | | function truncate() { |
| | | $this->init(); |
| | | |
| | |
| | | $st->execute(array($this->class)); |
| | | } |
| | | } |
| | | ?> |
| | | ?> |