Path: blob/master/src/infrastructure/storage/lisk/LiskRawMigrationIterator.php
12242 views
<?php12final class LiskRawMigrationIterator extends PhutilBufferedIterator {34private $conn;5private $table;6private $cursor;7private $column = 'id';89public function __construct(AphrontDatabaseConnection $conn, $table) {10$this->conn = $conn;11$this->table = $table;12}1314protected function didRewind() {15$this->cursor = 0;16}1718public function key() {19return idx($this->current(), $this->column);20}2122protected function loadPage() {23$page = queryfx_all(24$this->conn,25'SELECT * FROM %T WHERE %C > %d ORDER BY ID ASC LIMIT %d',26$this->table,27$this->column,28$this->cursor,29$this->getPageSize());3031if ($page) {32$this->cursor = idx(last($page), $this->column);33}3435return $page;36}3738}394041