Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889538
PhabricatorOAuthClientAuthorizationQuery.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
1 KB
Referenced Files
None
Subscribers
None
PhabricatorOAuthClientAuthorizationQuery.php
View Options
<?php
final
class
PhabricatorOAuthClientAuthorizationQuery
extends
PhabricatorCursorPagedPolicyAwareQuery
{
private
$phids
;
private
$userPHIDs
;
private
$clientPHIDs
;
public
function
withPHIDs
(
array
$phids
)
{
$this
->
phids
=
$phids
;
return
$this
;
}
public
function
withUserPHIDs
(
array
$phids
)
{
$this
->
userPHIDs
=
$phids
;
return
$this
;
}
public
function
withClientPHIDs
(
array
$phids
)
{
$this
->
clientPHIDs
=
$phids
;
return
$this
;
}
public
function
newResultObject
(
)
{
return
new
PhabricatorOAuthClientAuthorization
(
)
;
}
protected
function
willFilterPage
(
array
$authorizations
)
{
$client_phids
=
mpull
(
$authorizations
,
'getClientPHID'
)
;
$clients
=
id
(
new
PhabricatorOAuthServerClientQuery
(
)
)
->
setViewer
(
$this
->
getViewer
(
)
)
->
setParentQuery
(
$this
)
->
withPHIDs
(
$client_phids
)
->
execute
(
)
;
$clients
=
mpull
(
$clients
,
null
,
'getPHID'
)
;
foreach
(
$authorizations
as
$key
=>
$authorization
)
{
$client
=
idx
(
$clients
,
$authorization
->
getClientPHID
(
)
)
;
if
(
!
$client
)
{
$this
->
didRejectResult
(
$authorization
)
;
unset
(
$authorizations
[
$key
]
)
;
continue
;
}
$authorization
->
attachClient
(
$client
)
;
}
return
$authorizations
;
}
protected
function
buildWhereClauseParts
(
AphrontDatabaseConnection
$conn
)
{
$where
=
parent
::
buildWhereClauseParts
(
$conn
)
;
if
(
$this
->
phids
!==
null
)
{
$where
[
]
=
qsprintf
(
$conn
,
'phid IN (%Ls)'
,
$this
->
phids
)
;
}
if
(
$this
->
userPHIDs
!==
null
)
{
$where
[
]
=
qsprintf
(
$conn
,
'userPHID IN (%Ls)'
,
$this
->
userPHIDs
)
;
}
if
(
$this
->
clientPHIDs
!==
null
)
{
$where
[
]
=
qsprintf
(
$conn
,
'clientPHID IN (%Ls)'
,
$this
->
clientPHIDs
)
;
}
return
$where
;
}
public
function
getQueryApplicationClass
(
)
{
return
PhabricatorOAuthServerApplication
::
class
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 12:19 (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124481
Default Alt Text
PhabricatorOAuthClientAuthorizationQuery.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment