Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F119751763
PhameBlogQuery.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
Sun, Jun 29, 04:00
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jul 1, 04:00 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27051161
Attached To
rPH Phabricator
PhameBlogQuery.php
View Options
<?php
final
class
PhameBlogQuery
extends
PhabricatorCursorPagedPolicyAwareQuery
{
private
$ids
;
private
$phids
;
private
$domain
;
private
$needBloggers
;
public
function
withIDs
(
array
$ids
)
{
$this
->
ids
=
$ids
;
return
$this
;
}
public
function
withPHIDs
(
array
$phids
)
{
$this
->
phids
=
$phids
;
return
$this
;
}
public
function
withDomain
(
$domain
)
{
$this
->
domain
=
$domain
;
return
$this
;
}
protected
function
loadPage
()
{
$table
=
new
PhameBlog
();
$conn_r
=
$table
->
establishConnection
(
'r'
);
$where_clause
=
$this
->
buildWhereClause
(
$conn_r
);
$order_clause
=
$this
->
buildOrderClause
(
$conn_r
);
$limit_clause
=
$this
->
buildLimitClause
(
$conn_r
);
$data
=
queryfx_all
(
$conn_r
,
'SELECT * FROM %T b %Q %Q %Q'
,
$table
->
getTableName
(),
$where_clause
,
$order_clause
,
$limit_clause
);
$blogs
=
$table
->
loadAllFromArray
(
$data
);
return
$blogs
;
}
protected
function
buildWhereClause
(
AphrontDatabaseConnection
$conn_r
)
{
$where
=
array
();
if
(
$this
->
ids
)
{
$where
[]
=
qsprintf
(
$conn_r
,
'id IN (%Ls)'
,
$this
->
ids
);
}
if
(
$this
->
phids
)
{
$where
[]
=
qsprintf
(
$conn_r
,
'phid IN (%Ls)'
,
$this
->
phids
);
}
if
(
$this
->
domain
)
{
$where
[]
=
qsprintf
(
$conn_r
,
'domain = %s'
,
$this
->
domain
);
}
$where
[]
=
$this
->
buildPagingClause
(
$conn_r
);
return
$this
->
formatWhereClause
(
$where
);
}
public
function
getQueryApplicationClass
()
{
// TODO: Can we set this without breaking public blogs?
return
null
;
}
}
Event Timeline
Log In to Comment