Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F10750844
PhabricatorNotification.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorNotification.php
View Options
<?php
namespace
Nasqueron\Notifications\Notifications
;
use
Nasqueron\Notifications\Analyzers\PhabricatorPayloadAnalyzer
;
use
Nasqueron\Notifications\Notification
;
use
Nasqueron\Notifications\Phabricator\PhabricatorStory
;
class
PhabricatorNotification
extends
Notification
{
/**
* @var PhabricatorPayloadAnalyzer
*/
private
$analyzer
=
null
;
private
$story
;
/**
* Initializes a new PhabricatorNotification instance
*
* @param string $project The project for this notification
* @param PhabricatorStory $story The story to convert into a notification
* @param string[] $projects the list of the projects for this story
*/
public
function
__construct
(
$project
,
PhabricatorStory
$story
)
{
// Private property used by the analyzer
$this
->
story
=
$story
;
// Straightforward properties
$this
->
service
=
"Phabricator"
;
$this
->
project
=
$project
;
$this
->
rawContent
=
json_encode
(
$story
);
$this
->
text
=
$story
->
text
;
// Analyzes and fills
$this
->
type
=
$story
->
getObjectType
();
$this
->
group
=
$this
->
getGroup
();
$this
->
link
=
$this
->
getLink
();
}
/**
* Gets analyzer
*/
private
function
getAnalyzer
()
{
if
(
$this
->
analyzer
===
null
)
{
$this
->
analyzer
=
new
PhabricatorPayloadAnalyzer
(
$this
->
project
,
$this
->
story
);
}
return
$this
->
analyzer
;
}
/**
* Gets the target notificatrion group
*
* @return string the target group for the notification
*/
public
function
getGroup
()
{
return
$this
->
getAnalyzer
()->
getGroup
();
}
/**
* Gets the notification URL. Intended to be a widget or icon link.
*
* @return string
*/
public
function
getLink
()
{
return
""
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jul 27, 20:37 (16 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2768664
Default Alt Text
PhabricatorNotification.php (1 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment