Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F680018
DrydockLog.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
DrydockLog.php
View Options
<?php
final
class
DrydockLog
extends
DrydockDAO
implements
PhabricatorPolicyInterface
{
protected
$blueprintPHID
;
protected
$resourcePHID
;
protected
$leasePHID
;
protected
$operationPHID
;
protected
$epoch
;
protected
$type
;
protected
$data
=
array
();
private
$blueprint
=
self
::
ATTACHABLE
;
private
$resource
=
self
::
ATTACHABLE
;
private
$lease
=
self
::
ATTACHABLE
;
private
$operation
=
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?'
,
'operationPHID'
=>
'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'
),
),
'key_operation'
=>
array
(
'columns'
=>
array
(
'operationPHID'
,
'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
attachOperation
(
DrydockRepositoryOperation
$operation
=
null
)
{
$this
->
operation
=
$operation
;
return
$this
;
}
public
function
getOperation
()
{
return
$this
->
assertAttached
(
$this
->
operation
);
}
public
function
isComplete
()
{
if
(
$this
->
getBlueprintPHID
()
&&
!
$this
->
getBlueprint
())
{
return
false
;
}
if
(
$this
->
getResourcePHID
()
&&
!
$this
->
getResource
())
{
return
false
;
}
if
(
$this
->
getLeasePHID
()
&&
!
$this
->
getLease
())
{
return
false
;
}
if
(
$this
->
getOperationPHID
()
&&
!
$this
->
getOperation
())
{
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 all associated '
.
'blueprints, resources, leases, and repository operations.'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 27, 8:56 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
170498
Default Alt Text
DrydockLog.php (3 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment