protected function collectGarbage()
 {
     $log_table = new DrydockLog();
     $conn_w = $log_table->establishConnection('w');
     queryfx($conn_w, 'DELETE FROM %T WHERE epoch <= %d LIMIT 100', $log_table->getTableName(), $this->getGarbageEpoch());
     return $conn_w->getAffectedRows() == 100;
 }
예제 #2
0
 protected function loadPage()
 {
     $table = new DrydockLog();
     $conn_r = $table->establishConnection('r');
     $data = queryfx_all($conn_r, 'SELECT log.* FROM %T log %Q %Q %Q', $table->getTableName(), $this->buildWhereClause($conn_r), $this->buildOrderClause($conn_r), $this->buildLimitClause($conn_r));
     return $table->loadAllFromArray($data);
 }
예제 #3
0
 public function execute()
 {
     $table = new DrydockLog();
     $conn_r = $table->establishConnection('r');
     $where = $this->buildWhereClause($conn_r);
     $order = $this->buildOrderClause($conn_r);
     $limit = $this->buildLimitClause($conn_r);
     $data = queryfx_all($conn_r, 'SELECT log.* FROM %T log %Q %Q %Q', $table->getTableName(), $where, $order, $limit);
     return $table->loadAllFromArray($data);
 }