Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93296780
PhabricatorJenkinsJob.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, Nov 27, 17:23
Size
3 KB
Mime Type
text/x-php
Expires
Fri, Nov 29, 17:23 (2 d)
Engine
blob
Format
Raw Data
Handle
22612146
Attached To
rPH Phabricator
PhabricatorJenkinsJob.php
View Options
<?php
abstract
class
PhabricatorJenkinsJobDAO
extends
PhabricatorLiskDAO
{
public
function
getApplicationName
()
{
return
'jenkins'
;
}
}
final
class
PhabricatorJenkinsJob
extends
PhabricatorJenkinsJobDAO
implements
PhabricatorPolicyInterface
,
PhabricatorProjectInterface
{
protected
$repository
;
protected
$branch
;
protected
$projectPHID
;
protected
$buildPlanPHID
;
protected
$rulePHID
;
protected
$ownerPHID
;
protected
$viewPolicy
;
protected
$editPolicy
;
protected
$dateCreated
;
protected
$dateModified
;
private
$handle
=
self
::
ATTACHABLE
;
private
$object
=
self
::
ATTACHABLE
;
protected
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_NO_TABLE
=>
true
,
self
::
CONFIG_AUX_PHID
=>
true
,
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'repository'
=>
'phid'
,
'branch'
=>
'text128'
,
'projectPHID'
=>
'phid'
,
'buildPlanPHID'
=>
'phid'
,
'rulePHID'
=>
'phid'
,
'ownerPHID'
=>
'phid'
,
),
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'key_job'
=>
array
(
'columns'
=>
array
(
'ownerPHID'
,
'repository'
,
'branch'
),
'unique'
=>
true
,
),
),
)
+
parent
::
getConfiguration
();
}
public
function
generatePHID
()
{
return
PhabricatorPHID
::
generateNewPHID
(
'JOB'
);
}
public
function
getObject
()
{
return
$this
->
assertAttached
(
$this
->
object
);
}
public
function
attachObject
(
$object
)
{
$this
->
object
=
$object
;
return
$this
;
}
public
function
getHandle
()
{
return
$this
->
assertAttached
(
$this
->
handle
);
}
public
function
attachHandle
(
PhabricatorObjectHandle
$handle
)
{
$this
->
handle
=
$handle
;
return
$this
;
}
public
function
getRepository
()
{
return
$this
->
repository
;
}
public
function
setRepository
(
$repository
)
{
$this
->
repository
=
$repository
;
return
$this
;
}
public
function
getBranch
()
{
return
$this
->
branch
;
}
public
function
setBranch
(
$branch
)
{
$this
->
branch
=
$branch
;
return
$this
;
}
public
function
getProject
()
{
return
$this
->
projectPHID
;
}
public
function
setProject
(
$project
)
{
$this
->
projectPHID
=
$project
;
return
$this
;
}
public
function
getBuildPlan
()
{
return
$this
->
buildPlanPHID
;
}
public
function
setBuildPlan
(
$plan
)
{
$this
->
buildPlanPHID
=
$plan
;
return
$this
;
}
public
function
getRule
()
{
return
$this
->
rulePHID
;
}
public
function
setRule
(
$rule
)
{
$this
->
rulePHID
=
$rule
;
return
$this
;
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
);
}
public
function
getPolicy
(
$capability
)
{
return
PhabricatorPolicies
::
POLICY_NOONE
;
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
(
$viewer
->
getPHID
()
==
$this
->
getOwnerPHID
());
}
public
function
describeAutomaticCapability
(
$capability
)
{
return
pht
(
'Jenkins Jobs are private. Only you can view or edit your jobs.'
);
}
}
Event Timeline
Log In to Comment