Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93905932
LiskRawMigrationIterator.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Dec 2, 10:10
Size
771 B
Mime Type
text/x-php
Expires
Wed, Dec 4, 10:10 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22720824
Attached To
rPH Phabricator
LiskRawMigrationIterator.php
View Options
<?php
final
class
LiskRawMigrationIterator
extends
PhutilBufferedIterator
{
private
$conn
;
private
$table
;
private
$cursor
;
private
$column
=
'id'
;
public
function
__construct
(
AphrontDatabaseConnection
$conn
,
$table
)
{
$this
->
conn
=
$conn
;
$this
->
table
=
$table
;
}
protected
function
didRewind
()
{
$this
->
cursor
=
0
;
}
public
function
key
()
{
return
idx
(
$this
->
current
(),
$this
->
column
);
}
protected
function
loadPage
()
{
$page
=
queryfx_all
(
$this
->
conn
,
'SELECT * FROM %T WHERE %C > %d ORDER BY ID ASC LIMIT %d'
,
$this
->
table
,
$this
->
column
,
$this
->
cursor
,
$this
->
getPageSize
());
if
(
$page
)
{
$this
->
cursor
=
idx
(
last
(
$page
),
$this
->
column
);
}
return
$page
;
}
}
Event Timeline
Log In to Comment