Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4852603
PhragmentSnapshot.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhragmentSnapshot.php
View Options
<?php
final
class
PhragmentSnapshot
extends
PhragmentDAO
implements
PhabricatorPolicyInterface
{
protected
$primaryFragmentPHID
;
protected
$name
;
private
$primaryFragment
=
self
::
ATTACHABLE
;
public
function
getConfiguration
(
)
{
return
array
(
self
::
CONFIG_AUX_PHID
=>
true
,
)
+
parent
::
getConfiguration
(
)
;
}
public
function
generatePHID
(
)
{
return
PhabricatorPHID
::
generateNewPHID
(
PhragmentPHIDTypeSnapshot
::
TYPECONST
)
;
}
public
function
getURI
(
)
{
return
'/phragment/snapshot/view/'
.
$this
->
getID
(
)
.
'/'
;
}
public
function
getPrimaryFragment
(
)
{
return
$this
->
assertAttached
(
$this
->
primaryFragment
)
;
}
public
function
attachPrimaryFragment
(
PhragmentFragment
$fragment
)
{
return
$this
->
primaryFragment
=
$fragment
;
}
public
function
delete
(
)
{
$children
=
id
(
new
PhragmentSnapshotChild
(
)
)
->
loadAllWhere
(
'snapshotPHID = %s'
,
$this
->
getPHID
(
)
)
;
$this
->
openTransaction
(
)
;
foreach
(
$children
as
$child
)
{
$child
->
delete
(
)
;
}
$result
=
parent
::
delete
(
)
;
$this
->
saveTransaction
(
)
;
return
$result
;
}
/* -( Policy Interface )--------------------------------------------------- */
public
function
getCapabilities
(
)
{
return
$this
->
getPrimaryFragment
(
)
->
getCapabilities
(
)
;
}
public
function
getPolicy
(
$capability
)
{
return
$this
->
getPrimaryFragment
(
)
->
getPolicy
(
$capability
)
;
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
$this
->
getPrimaryFragment
(
)
->
hasAutomaticCapability
(
$capability
,
$viewer
)
;
}
public
function
describeAutomaticCapability
(
$capability
)
{
return
$this
->
getPrimaryFragment
(
)
->
describeAutomaticCapability
(
$capability
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jun 9, 06:42 (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1768487
Default Alt Text
PhragmentSnapshot.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment