Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F468532
HarbormasterRunBuildPlansHeraldAction.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
HarbormasterRunBuildPlansHeraldAction.php
View Options
<?php
final
class
HarbormasterRunBuildPlansHeraldAction
extends
HeraldAction
{
const
DO_BUILD
=
'do.build'
;
const
ACTIONCONST
=
'harbormaster.build'
;
public
function
getActionGroupKey
()
{
return
HeraldSupportActionGroup
::
ACTIONGROUPKEY
;
}
public
function
supportsObject
(
$object
)
{
$adapter
=
$this
->
getAdapter
();
return
(
$adapter
instanceof
HarbormasterBuildableAdapterInterface
);
}
protected
function
applyBuilds
(
array
$phids
)
{
$adapter
=
$this
->
getAdapter
();
$allowed_types
=
array
(
HarbormasterBuildPlanPHIDType
::
TYPECONST
,
);
$targets
=
$this
->
loadStandardTargets
(
$phids
,
$allowed_types
,
array
());
if
(!
$targets
)
{
return
;
}
$phids
=
array_fuse
(
array_keys
(
$targets
));
foreach
(
$phids
as
$phid
)
{
$adapter
->
queueHarbormasterBuildPlanPHID
(
$phid
);
}
$this
->
logEffect
(
self
::
DO_BUILD
,
$phids
);
}
protected
function
getActionEffectMap
()
{
return
array
(
self
::
DO_BUILD
=>
array
(
'icon'
=>
'fa-play'
,
'color'
=>
'green'
,
'name'
=>
pht
(
'Building'
),
),
);
}
protected
function
renderActionEffectDescription
(
$type
,
$data
)
{
switch
(
$type
)
{
case
self
::
DO_BUILD
:
return
pht
(
'Started %s build(s): %s.'
,
new
PhutilNumber
(
count
(
$data
)),
$this
->
renderHandleList
(
$data
));
}
}
public
function
getHeraldActionName
()
{
return
pht
(
'Run build plans'
);
}
public
function
supportsRuleType
(
$rule_type
)
{
return
(
$rule_type
!=
HeraldRuleTypeConfig
::
RULE_TYPE_PERSONAL
);
}
public
function
applyEffect
(
$object
,
HeraldEffect
$effect
)
{
return
$this
->
applyBuilds
(
$effect
->
getTarget
());
}
public
function
getHeraldActionStandardType
()
{
return
self
::
STANDARD_PHID_LIST
;
}
protected
function
getDatasource
()
{
return
new
HarbormasterBuildPlanDatasource
();
}
public
function
renderActionDescription
(
$value
)
{
return
pht
(
'Run build plans: %s.'
,
$this
->
renderHandleList
(
$value
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 6, 5:42 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
80704
Default Alt Text
HarbormasterRunBuildPlansHeraldAction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment