Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F464673
ProjectAddProjectsEmailCommand.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ProjectAddProjectsEmailCommand.php
View Options
<?php
final
class
ProjectAddProjectsEmailCommand
extends
MetaMTAEmailTransactionCommand
{
public
function
getCommand
()
{
return
'projects'
;
}
public
function
getCommandSyntax
()
{
return
'**!projects** //#project ...//'
;
}
public
function
getCommandSummary
()
{
return
pht
(
'Add related projects.'
);
}
public
function
getCommandDescription
()
{
return
pht
(
'Add one or more projects to the object by listing their hashtags. '
.
'Separate projects with spaces. For example, use `!projects #ios '
.
'#feature` to add both related projects.'
.
"
\n\n
"
.
'Projects which are invalid or unrecognized will be ignored. This '
.
'command has no effect if you do not specify any projects.'
);
}
public
function
getCommandAliases
()
{
return
array
(
'project'
,
);
}
public
function
isCommandSupportedForObject
(
PhabricatorApplicationTransactionInterface
$object
)
{
return
(
$object
instanceof
PhabricatorProjectInterface
);
}
public
function
buildTransactions
(
PhabricatorUser
$viewer
,
PhabricatorApplicationTransactionInterface
$object
,
PhabricatorMetaMTAReceivedMail
$mail
,
$command
,
array
$argv
)
{
$project_phids
=
id
(
new
PhabricatorObjectListQuery
())
->
setViewer
(
$viewer
)
->
setAllowedTypes
(
array
(
PhabricatorProjectProjectPHIDType
::
TYPECONST
,
))
->
setObjectList
(
implode
(
' '
,
$argv
))
->
setAllowPartialResults
(
true
)
->
execute
();
$xactions
=
array
();
$type_project
=
PhabricatorProjectObjectHasProjectEdgeType
::
EDGECONST
;
$xactions
[]
=
$object
->
getApplicationTransactionTemplate
()
->
setTransactionType
(
PhabricatorTransactions
::
TYPE_EDGE
)
->
setMetadataValue
(
'edge:type'
,
$type_project
)
->
setNewValue
(
array
(
'+'
=>
array_fuse
(
$project_phids
),
));
return
$xactions
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 9:43 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
78534
Default Alt Text
ProjectAddProjectsEmailCommand.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment