Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101484769
PhabricatorProjectTriggerRule.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
Mon, Feb 10, 22:06
Size
3 KB
Mime Type
text/x-php
Expires
Wed, Feb 12, 22:06 (2 d)
Engine
blob
Format
Raw Data
Handle
24161434
Attached To
rPH Phabricator
PhabricatorProjectTriggerRule.php
View Options
<?php
abstract
class
PhabricatorProjectTriggerRule
extends
Phobject
{
private
$record
;
private
$viewer
;
private
$column
;
private
$trigger
;
private
$object
;
final
public
function
getTriggerType
()
{
return
$this
->
getPhobjectClassConstant
(
'TRIGGERTYPE'
,
64
);
}
final
public
static
function
getAllTriggerRules
()
{
return
id
(
new
PhutilClassMapQuery
())
->
setAncestorClass
(
__CLASS__
)
->
setUniqueMethod
(
'getTriggerType'
)
->
execute
();
}
final
public
function
setRecord
(
PhabricatorProjectTriggerRuleRecord
$record
)
{
$value
=
$record
->
getValue
();
$this
->
assertValidRuleValue
(
$value
);
$this
->
record
=
$record
;
return
$this
;
}
final
public
function
getRecord
()
{
return
$this
->
record
;
}
final
protected
function
getValue
()
{
return
$this
->
getRecord
()->
getValue
();
}
abstract
public
function
getSelectControlName
();
abstract
public
function
getRuleViewLabel
();
abstract
public
function
getRuleViewDescription
(
$value
);
abstract
public
function
getRuleViewIcon
(
$value
);
abstract
protected
function
assertValidRuleValue
(
$value
);
abstract
protected
function
newDropTransactions
(
$object
,
$value
);
abstract
protected
function
newDropEffects
(
$value
);
abstract
protected
function
getDefaultValue
();
abstract
protected
function
getPHUIXControlType
();
abstract
protected
function
getPHUIXControlSpecification
();
protected
function
isSelectableRule
()
{
return
true
;
}
protected
function
isValidRule
()
{
return
true
;
}
protected
function
newInvalidView
()
{
return
null
;
}
public
function
getSoundEffects
()
{
return
array
();
}
final
public
function
getDropTransactions
(
$object
,
$value
)
{
return
$this
->
newDropTransactions
(
$object
,
$value
);
}
final
public
function
setViewer
(
PhabricatorUser
$viewer
)
{
$this
->
viewer
=
$viewer
;
return
$this
;
}
final
public
function
getViewer
()
{
return
$this
->
viewer
;
}
final
public
function
setColumn
(
PhabricatorProjectColumn
$column
)
{
$this
->
column
=
$column
;
return
$this
;
}
final
public
function
getColumn
()
{
return
$this
->
column
;
}
final
public
function
setTrigger
(
PhabricatorProjectTrigger
$trigger
)
{
$this
->
trigger
=
$trigger
;
return
$this
;
}
final
public
function
getTrigger
()
{
return
$this
->
trigger
;
}
final
public
function
setObject
(
PhabricatorApplicationTransactionInterface
$object
)
{
$this
->
object
=
$object
;
return
$this
;
}
final
public
function
getObject
()
{
return
$this
->
object
;
}
final
protected
function
newTransaction
()
{
return
$this
->
getObject
()->
getApplicationTransactionTemplate
();
}
final
public
function
getDropEffects
()
{
return
$this
->
newDropEffects
(
$this
->
getValue
());
}
final
protected
function
newEffect
()
{
return
id
(
new
PhabricatorProjectDropEffect
())
->
setIsTriggerEffect
(
true
);
}
final
public
function
toDictionary
()
{
$record
=
$this
->
getRecord
();
$is_valid
=
$this
->
isValidRule
();
if
(!
$is_valid
)
{
$invalid_view
=
hsprintf
(
'%s'
,
$this
->
newInvalidView
());
}
else
{
$invalid_view
=
null
;
}
return
array
(
'type'
=>
$record
->
getType
(),
'value'
=>
$record
->
getValue
(),
'isValidRule'
=>
$is_valid
,
'invalidView'
=>
$invalid_view
,
);
}
final
public
function
newTemplate
()
{
return
array
(
'type'
=>
$this
->
getTriggerType
(),
'name'
=>
$this
->
getSelectControlName
(),
'selectable'
=>
$this
->
isSelectableRule
(),
'defaultValue'
=>
$this
->
getDefaultValue
(),
'control'
=>
array
(
'type'
=>
$this
->
getPHUIXControlType
(),
'specification'
=>
$this
->
getPHUIXControlSpecification
(),
),
);
}
}
Event Timeline
Log In to Comment