Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F105225303
DrydockLog.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
Sat, Mar 15, 14:33
Size
2 KB
Mime Type
text/x-php
Expires
Mon, Mar 17, 14:33 (2 d)
Engine
blob
Format
Raw Data
Handle
24947275
Attached To
rPH Phabricator
DrydockLog.php
View Options
<?php
final
class
DrydockLog
extends
DrydockDAO
implements
PhabricatorPolicyInterface
{
protected
$blueprintPHID
;
protected
$resourcePHID
;
protected
$leasePHID
;
protected
$epoch
;
protected
$type
;
protected
$data
=
array
();
private
$blueprint
=
self
::
ATTACHABLE
;
private
$resource
=
self
::
ATTACHABLE
;
private
$lease
=
self
::
ATTACHABLE
;
protected
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_TIMESTAMPS
=>
false
,
self
::
CONFIG_SERIALIZATION
=>
array
(
'data'
=>
self
::
SERIALIZATION_JSON
,
),
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'blueprintPHID'
=>
'phid?'
,
'resourcePHID'
=>
'phid?'
,
'leasePHID'
=>
'phid?'
,
'type'
=>
'text64'
,
),
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'key_blueprint'
=>
array
(
'columns'
=>
array
(
'blueprintPHID'
,
'type'
),
),
'key_resource'
=>
array
(
'columns'
=>
array
(
'resourcePHID'
,
'type'
),
),
'key_lease'
=>
array
(
'columns'
=>
array
(
'leasePHID'
,
'type'
),
),
'epoch'
=>
array
(
'columns'
=>
array
(
'epoch'
),
),
),
)
+
parent
::
getConfiguration
();
}
public
function
attachBlueprint
(
DrydockBlueprint
$blueprint
=
null
)
{
$this
->
blueprint
=
$blueprint
;
return
$this
;
}
public
function
getBlueprint
()
{
return
$this
->
assertAttached
(
$this
->
blueprint
);
}
public
function
attachResource
(
DrydockResource
$resource
=
null
)
{
$this
->
resource
=
$resource
;
return
$this
;
}
public
function
getResource
()
{
return
$this
->
assertAttached
(
$this
->
resource
);
}
public
function
attachLease
(
DrydockLease
$lease
=
null
)
{
$this
->
lease
=
$lease
;
return
$this
;
}
public
function
getLease
()
{
return
$this
->
assertAttached
(
$this
->
lease
);
}
public
function
isComplete
()
{
if
(
$this
->
getBlueprintPHID
()
&&
!
$this
->
getBlueprint
())
{
return
false
;
}
if
(
$this
->
getResourcePHID
()
&&
!
$this
->
getResource
())
{
return
false
;
}
if
(
$this
->
getLeasePHID
()
&&
!
$this
->
getLease
())
{
return
false
;
}
return
true
;
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
);
}
public
function
getPolicy
(
$capability
)
{
// NOTE: We let you see that logs exist no matter what, but don't actually
// show you log content unless you can see all of the associated objects.
return
PhabricatorPolicies
::
getMostOpenPolicy
();
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
false
;
}
public
function
describeAutomaticCapability
(
$capability
)
{
return
pht
(
'To view log details, you must be able to view the associated '
.
'blueprint, resource and lease.'
);
}
}
Event Timeline
Log In to Comment