Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93550772
PhabricatorFeedStoryAggregate.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
Fri, Nov 29, 16:11
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 16:11 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22656853
Attached To
rPH Phabricator
PhabricatorFeedStoryAggregate.php
View Options
<?php
abstract
class
PhabricatorFeedStoryAggregate
extends
PhabricatorFeedStory
{
private
$aggregateStories
=
array
();
public
function
getHasViewed
()
{
return
head
(
$this
->
getAggregateStories
())->
getHasViewed
();
}
public
function
getPrimaryObjectPHID
()
{
return
head
(
$this
->
getAggregateStories
())->
getPrimaryObjectPHID
();
}
public
function
getRequiredHandlePHIDs
()
{
$phids
=
array
();
foreach
(
$this
->
getAggregateStories
()
as
$story
)
{
$phids
[]
=
$story
->
getRequiredHandlePHIDs
();
}
return
array_mergev
(
$phids
);
}
public
function
getRequiredObjectPHIDs
()
{
$phids
=
array
();
foreach
(
$this
->
getAggregateStories
()
as
$story
)
{
$phids
[]
=
$story
->
getRequiredObjectPHIDs
();
}
return
array_mergev
(
$phids
);
}
protected
function
getAuthorPHIDs
()
{
$authors
=
array
();
foreach
(
$this
->
getAggregateStories
()
as
$story
)
{
$authors
[]
=
$story
->
getStoryData
()->
getAuthorPHID
();
}
return
array_unique
(
array_filter
(
$authors
));
}
protected
function
getDataValues
(
$key
,
$default
)
{
$result
=
array
();
foreach
(
$this
->
getAggregateStories
()
as
$key
=>
$story
)
{
$result
[
$key
]
=
$story
->
getStoryData
()->
getValue
(
$key
,
$default
);
}
return
$result
;
}
final
public
function
setAggregateStories
(
array
$aggregate_stories
)
{
assert_instances_of
(
$aggregate_stories
,
'PhabricatorFeedStory'
);
$this
->
aggregateStories
=
$aggregate_stories
;
$objects
=
array
();
$handles
=
array
();
foreach
(
$this
->
aggregateStories
as
$story
)
{
$objects
+=
$story
->
getObjects
();
$handles
+=
$story
->
getHandles
();
}
$this
->
setObjects
(
$objects
);
$this
->
setHandles
(
$handles
);
return
$this
;
}
final
public
function
getAggregateStories
()
{
return
$this
->
aggregateStories
;
}
final
public
function
getNotificationAggregations
()
{
throw
new
Exception
(
"You can not get aggregations for an aggregate story."
);
}
}
Event Timeline
Log In to Comment