Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81170742
DiffusionPreCommitRefTypeHeraldField.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
Wed, Sep 4, 13:45
Size
949 B
Mime Type
text/x-php
Expires
Fri, Sep 6, 13:45 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
20522822
Attached To
rPH Phabricator
DiffusionPreCommitRefTypeHeraldField.php
View Options
<?php
final
class
DiffusionPreCommitRefTypeHeraldField
extends
DiffusionPreCommitRefHeraldField
{
const
FIELDCONST
=
'diffusion.pre.ref.type'
;
public
function
getHeraldFieldName
()
{
return
pht
(
'Ref type'
);
}
public
function
getHeraldFieldValue
(
$object
)
{
return
$object
->
getRefType
();
}
public
function
getHeraldFieldConditions
()
{
return
array
(
HeraldAdapter
::
CONDITION_IS
,
HeraldAdapter
::
CONDITION_IS_NOT
,
);
}
public
function
getHeraldFieldValueType
(
$condition
)
{
$types
=
array
(
PhabricatorRepositoryPushLog
::
REFTYPE_BRANCH
=>
pht
(
'branch (git/hg)'
),
PhabricatorRepositoryPushLog
::
REFTYPE_TAG
=>
pht
(
'tag (git)'
),
PhabricatorRepositoryPushLog
::
REFTYPE_BOOKMARK
=>
pht
(
'bookmark (hg)'
),
);
return
id
(
new
HeraldSelectFieldValue
())
->
setKey
(
self
::
FIELDCONST
)
->
setOptions
(
$types
)
->
setDefault
(
PhabricatorRepositoryPushLog
::
REFTYPE_BRANCH
);
}
}
Event Timeline
Log In to Comment