Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96621847
PhabricatorAuthInviteQuery.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, Dec 29, 02:13
Size
2 KB
Mime Type
text/x-php
Expires
Tue, Dec 31, 02:13 (1 d, 6 h)
Engine
blob
Format
Raw Data
Handle
23201046
Attached To
rPH Phabricator
PhabricatorAuthInviteQuery.php
View Options
<?php
final
class
PhabricatorAuthInviteQuery
extends
PhabricatorCursorPagedPolicyAwareQuery
{
private
$ids
;
private
$phids
;
private
$emailAddresses
;
private
$verificationCodes
;
private
$authorPHIDs
;
public
function
withIDs
(
array
$ids
)
{
$this
->
ids
=
$ids
;
return
$this
;
}
public
function
withPHIDs
(
array
$phids
)
{
$this
->
phids
=
$phids
;
return
$this
;
}
public
function
withEmailAddresses
(
array
$addresses
)
{
$this
->
emailAddresses
=
$addresses
;
return
$this
;
}
public
function
withVerificationCodes
(
array
$codes
)
{
$this
->
verificationCodes
=
$codes
;
return
$this
;
}
public
function
withAuthorPHIDs
(
array
$phids
)
{
$this
->
authorPHIDs
=
$phids
;
return
$this
;
}
protected
function
loadPage
()
{
$table
=
new
PhabricatorAuthInvite
();
$conn_r
=
$table
->
establishConnection
(
'r'
);
$data
=
queryfx_all
(
$conn_r
,
'SELECT * FROM %T %Q %Q %Q'
,
$table
->
getTableName
(),
$this
->
buildWhereClause
(
$conn_r
),
$this
->
buildOrderClause
(
$conn_r
),
$this
->
buildLimitClause
(
$conn_r
));
$invites
=
$table
->
loadAllFromArray
(
$data
);
// If the objects were loaded via verification code, set a flag to make
// sure the viewer can see them.
if
(
$this
->
verificationCodes
!==
null
)
{
foreach
(
$invites
as
$invite
)
{
$invite
->
setViewerHasVerificationCode
(
true
);
}
}
return
$invites
;
}
protected
function
buildWhereClause
(
AphrontDatabaseConnection
$conn
)
{
$where
=
array
();
if
(
$this
->
ids
!==
null
)
{
$where
[]
=
qsprintf
(
$conn
,
'id IN (%Ld)'
,
$this
->
ids
);
}
if
(
$this
->
phids
!==
null
)
{
$where
[]
=
qsprintf
(
$conn
,
'phid IN (%Ls)'
,
$this
->
phids
);
}
if
(
$this
->
emailAddresses
!==
null
)
{
$where
[]
=
qsprintf
(
$conn
,
'emailAddress IN (%Ls)'
,
$this
->
emailAddresses
);
}
if
(
$this
->
verificationCodes
!==
null
)
{
$hashes
=
array
();
foreach
(
$this
->
verificationCodes
as
$code
)
{
$hashes
[]
=
PhabricatorHash
::
digestForIndex
(
$code
);
}
$where
[]
=
qsprintf
(
$conn
,
'verificationHash IN (%Ls)'
,
$hashes
);
}
if
(
$this
->
authorPHIDs
!==
null
)
{
$where
[]
=
qsprintf
(
$conn
,
'authorPHID IN (%Ls)'
,
$this
->
authorPHIDs
);
}
$where
[]
=
$this
->
buildPagingClause
(
$conn
);
return
$this
->
formatWhereClause
(
$conn
,
$where
);
}
public
function
getQueryApplicationClass
()
{
// NOTE: This query is issued by logged-out users, who often will not be
// able to see applications. They still need to be able to see invites.
return
null
;
}
}
Event Timeline
Log In to Comment