Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104766926
HarbormasterBuildable.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, Mar 12, 05:34
Size
2 KB
Mime Type
text/x-php
Expires
Fri, Mar 14, 05:34 (1 d, 16 h)
Engine
blob
Format
Raw Data
Handle
24846573
Attached To
rPH Phabricator
HarbormasterBuildable.php
View Options
<?php
final
class
HarbormasterBuildable
extends
HarbormasterDAO
implements
PhabricatorPolicyInterface
{
protected
$buildablePHID
;
protected
$containerPHID
;
protected
$buildStatus
;
protected
$buildableStatus
;
private
$buildableObject
=
self
::
ATTACHABLE
;
private
$containerObject
=
self
::
ATTACHABLE
;
private
$buildableHandle
=
self
::
ATTACHABLE
;
public
static
function
initializeNewBuildable
(
PhabricatorUser
$actor
)
{
return
id
(
new
HarbormasterBuildable
())
->
setBuildStatus
(
'new'
)
// TODO: Define these.
->
setBuildableStatus
(
'active'
);
// TODO: Define these, too.
}
public
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_AUX_PHID
=>
true
,
)
+
parent
::
getConfiguration
();
}
public
function
generatePHID
()
{
return
PhabricatorPHID
::
generateNewPHID
(
HarbormasterPHIDTypeBuildable
::
TYPECONST
);
}
public
function
attachBuildableObject
(
$buildable_object
)
{
$this
->
buildableObject
=
$buildable_object
;
return
$this
;
}
public
function
getBuildableObject
()
{
return
$this
->
assertAttached
(
$this
->
buildableObject
);
}
public
function
attachContainerObject
(
$container_object
)
{
$this
->
containerObject
=
$container_object
;
return
$this
;
}
public
function
getContainerObject
()
{
return
$this
->
assertAttached
(
$this
->
containerObject
);
}
public
function
attachBuildableHandle
(
$buildable_handle
)
{
$this
->
buildableHandle
=
$buildable_handle
;
return
$this
;
}
public
function
getBuildableHandle
()
{
return
$this
->
assertAttached
(
$this
->
buildableHandle
);
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
);
}
public
function
getPolicy
(
$capability
)
{
return
$this
->
getBuildableObject
()->
getPolicy
(
$capability
);
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
$this
->
getBuildableObject
()->
hasAutomaticCapability
(
$capability
,
$viewer
);
}
public
function
describeAutomaticCapability
(
$capability
)
{
return
pht
(
'Users must be able to see the revision or repository to see a '
.
'buildable.'
);
}
}
Event Timeline
Log In to Comment