Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93055293
DifferentialRevisionResultBucket.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, Nov 25, 20:56
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Nov 27, 20:56 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22563664
Attached To
rPH Phabricator
DifferentialRevisionResultBucket.php
View Options
<?php
abstract
class
DifferentialRevisionResultBucket
extends
PhabricatorSearchResultBucket
{
public
static
function
getAllResultBuckets
()
{
return
id
(
new
PhutilClassMapQuery
())
->
setAncestorClass
(
__CLASS__
)
->
setUniqueMethod
(
'getResultBucketKey'
)
->
execute
();
}
protected
function
getRevisionsUnderReview
(
array
$objects
,
array
$phids
)
{
$results
=
array
();
$objects
=
$this
->
getRevisionsNotAuthored
(
$objects
,
$phids
);
$status_review
=
ArcanistDifferentialRevisionStatus
::
NEEDS_REVIEW
;
foreach
(
$objects
as
$key
=>
$object
)
{
if
(
$object
->
getStatus
()
!=
$status_review
)
{
continue
;
}
$results
[
$key
]
=
$object
;
}
return
$results
;
}
protected
function
getRevisionsAuthored
(
array
$objects
,
array
$phids
)
{
$results
=
array
();
foreach
(
$objects
as
$key
=>
$object
)
{
if
(
isset
(
$phids
[
$object
->
getAuthorPHID
()]))
{
$results
[
$key
]
=
$object
;
}
}
return
$results
;
}
protected
function
getRevisionsNotAuthored
(
array
$objects
,
array
$phids
)
{
$results
=
array
();
foreach
(
$objects
as
$key
=>
$object
)
{
if
(
empty
(
$phids
[
$object
->
getAuthorPHID
()]))
{
$results
[
$key
]
=
$object
;
}
}
return
$results
;
}
protected
function
hasReviewersWithStatus
(
DifferentialRevision
$revision
,
array
$phids
,
array
$statuses
)
{
foreach
(
$revision
->
getReviewers
()
as
$reviewer
)
{
$reviewer_phid
=
$reviewer
->
getReviewerPHID
();
if
(
empty
(
$phids
[
$reviewer_phid
]))
{
continue
;
}
$status
=
$reviewer
->
getReviewerStatus
();
if
(
empty
(
$statuses
[
$status
]))
{
continue
;
}
return
true
;
}
return
false
;
}
}
Event Timeline
Log In to Comment