70 public function set($code, $data)
73 if (!in_array($code, $this->multipleCode,
true))
75 $res = StorageTable::getList(
78 '=CONTEXT' => $this->context,
83 if ($item = $res->fetch())
85 StorageTable::deleteFile($item);
92 'CONTEXT' => $this->context,
98 $result = StorageTable::update($id, $save);
102 $result = StorageTable::add($save);
105 return $result->isSuccess();
114 public function get($code)
118 $isMultiple = in_array($code, $this->multipleCode,
true);
120 $res = StorageTable::getList(
123 '=CONTEXT' => $this->context,
128 while ($item = $res->fetch())
130 $item[
'CREATE_TIME']->add(self::TTL_CONTEXT .
'second');
131 if ($item[
'CREATE_TIME'] > $now)
135 $result = $item[
'DATA'];
139 $result[$item[
'ID']] = $item[
'DATA'];
143 StorageTable::deleteFile($item);
144 StorageTable::delete($item[
'ID']);