Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892178
PhabricatorAuthPasswordQuery.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
PhabricatorAuthPasswordQuery.php
View Options
<?php
final
class
PhabricatorAuthPasswordQuery
extends
PhabricatorCursorPagedPolicyAwareQuery
{
private
$ids
;
private
$phids
;
private
$objectPHIDs
;
private
$passwordTypes
;
private
$isRevoked
;
public
function
withIDs
(
array
$ids
)
{
$this
->
ids
=
$ids
;
return
$this
;
}
public
function
withPHIDs
(
array
$phids
)
{
$this
->
phids
=
$phids
;
return
$this
;
}
public
function
withObjectPHIDs
(
array
$object_phids
)
{
$this
->
objectPHIDs
=
$object_phids
;
return
$this
;
}
public
function
withPasswordTypes
(
array
$types
)
{
$this
->
passwordTypes
=
$types
;
return
$this
;
}
public
function
withIsRevoked
(
$is_revoked
)
{
$this
->
isRevoked
=
$is_revoked
;
return
$this
;
}
public
function
newResultObject
(
)
{
return
new
PhabricatorAuthPassword
(
)
;
}
protected
function
buildWhereClauseParts
(
AphrontDatabaseConnection
$conn
)
{
$where
=
parent
::
buildWhereClauseParts
(
$conn
)
;
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
->
objectPHIDs
!==
null
)
{
$where
[
]
=
qsprintf
(
$conn
,
'objectPHID IN (%Ls)'
,
$this
->
objectPHIDs
)
;
}
if
(
$this
->
passwordTypes
!==
null
)
{
$where
[
]
=
qsprintf
(
$conn
,
'passwordType IN (%Ls)'
,
$this
->
passwordTypes
)
;
}
if
(
$this
->
isRevoked
!==
null
)
{
$where
[
]
=
qsprintf
(
$conn
,
'isRevoked = %d'
,
(int)
$this
->
isRevoked
)
;
}
return
$where
;
}
protected
function
willFilterPage
(
array
$passwords
)
{
$object_phids
=
mpull
(
$passwords
,
'getObjectPHID'
)
;
$objects
=
id
(
new
PhabricatorObjectQuery
(
)
)
->
setViewer
(
$this
->
getViewer
(
)
)
->
setParentQuery
(
$this
)
->
withPHIDs
(
$object_phids
)
->
execute
(
)
;
$objects
=
mpull
(
$objects
,
null
,
'getPHID'
)
;
foreach
(
$passwords
as
$key
=>
$password
)
{
$object
=
idx
(
$objects
,
$password
->
getObjectPHID
(
)
)
;
if
(
!
$object
)
{
unset
(
$passwords
[
$key
]
)
;
$this
->
didRejectResult
(
$password
)
;
continue
;
}
$password
->
attachObject
(
$object
)
;
}
return
$passwords
;
}
public
function
getQueryApplicationClass
(
)
{
return
PhabricatorAuthApplication
::
class
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 16:22 (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126436
Default Alt Text
PhabricatorAuthPasswordQuery.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment