| @@ 288-305 (lines=18) @@ | ||
| 285 | * @return string Return '' if no last_ts remembered. |
|
| 286 | * @see $sDbProfSrce |
|
| 287 | */ |
|
| 288 | protected function GetLastTs($db_dest, $tbl_srce) { |
|
| 289 | $sql = $db_dest->GenSql(array( |
|
| 290 | 'SELECT' => 'last_ts', |
|
| 291 | 'FROM' => $this->sTblRecord, |
|
| 292 | 'WHERE' => array( |
|
| 293 | "db_prof = '{$this->sDbProfSrce}'", |
|
| 294 | "tbl_title = '$tbl_srce'", |
|
| 295 | ), |
|
| 296 | 'LIMIT' => 1, |
|
| 297 | )); |
|
| 298 | $rs = $db_dest->Execute($sql); |
|
| 299 | if (0 < $rs->RowCount()) { |
|
| 300 | return $rs->fields['last_ts']; |
|
| 301 | } |
|
| 302 | else { |
|
| 303 | return ''; |
|
| 304 | } |
|
| 305 | } // end of func GetLastTs |
|
| 306 | ||
| 307 | ||
| 308 | /** |
|
| @@ 255-277 (lines=23) @@ | ||
| 252 | * @param $table Table name in source db |
|
| 253 | * @return string Return null if no last_ts remembered |
|
| 254 | */ |
|
| 255 | protected function getLastTimestamp($dbDest, $table) |
|
| 256 | { |
|
| 257 | $dbProf = $this->getDbSourceProfileString(); |
|
| 258 | ||
| 259 | $rs = $dbDest->execute( |
|
| 260 | [ |
|
| 261 | 'SELECT' => 'last_ts', |
|
| 262 | 'FROM' => $this->tableRecord, |
|
| 263 | 'WHERE' => [ |
|
| 264 | "db_prof = '{$dbProf}'", |
|
| 265 | "tbl_title = '$table'", |
|
| 266 | ], |
|
| 267 | 'LIMIT' => 1, |
|
| 268 | ] |
|
| 269 | ); |
|
| 270 | ||
| 271 | if (0 < $rs->RowCount()) { |
|
| 272 | return $rs->fields['last_ts']; |
|
| 273 | ||
| 274 | } else { |
|
| 275 | return null; |
|
| 276 | } |
|
| 277 | } |
|
| 278 | ||
| 279 | ||
| 280 | /** |
|