Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97896574
PhabricatorCountdown.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
Tue, Jan 7, 08:00
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Jan 9, 08:00 (2 d)
Engine
blob
Format
Raw Data
Handle
23433880
Attached To
rPH Phabricator
PhabricatorCountdown.php
View Options
<?php
/**
* @group countdown
*/
final
class
PhabricatorCountdown
extends
PhabricatorCountdownDAO
implements
PhabricatorPolicyInterface
{
protected
$title
;
protected
$authorPHID
;
protected
$epoch
;
// protected $viewPolicy; //commented out till we have it on countdown table
public
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_AUX_PHID
=>
true
,
)
+
parent
::
getConfiguration
();
}
public
function
generatePHID
()
{
return
PhabricatorPHID
::
generateNewPHID
(
PhabricatorCountdownPHIDTypeCountdown
::
TYPECONST
);
}
public
function
getViewPolicy
()
{
return
PhabricatorPolicies
::
POLICY_USER
;
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
);
}
public
function
getPolicy
(
$capability
)
{
switch
(
$capability
)
{
case
PhabricatorPolicyCapability
::
CAN_VIEW
:
return
$this
->
getViewPolicy
();
case
PhabricatorPolicyCapability
::
CAN_EDIT
:
return
PhabricatorPolicies
::
POLICY_NOONE
;
}
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
(
$viewer
->
getPHID
()
==
$this
->
getAuthorPHID
());
}
public
function
describeAutomaticCapability
(
$capability
)
{
return
pht
(
'The author of a countdown can always view and edit it.'
);
}
}
Event Timeline
Log In to Comment