Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1186114
PhabricatorProjectTriggerRule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
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
getDescription
();
abstract
public
function
getSelectControlName
();
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
;
}
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
new
PhabricatorProjectDropEffect
();
}
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
(),
),
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Jul 2, 1:33 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
293448
Default Alt Text
PhabricatorProjectTriggerRule.php (3 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment