Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102191610
NuanceQueue.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, Feb 18, 02:33
Size
2 KB
Mime Type
text/x-php
Expires
Thu, Feb 20, 02:33 (2 d)
Engine
blob
Format
Raw Data
Handle
24303191
Attached To
rPH Phabricator
NuanceQueue.php
View Options
<?php
final
class
NuanceQueue
extends
NuanceDAO
implements
PhabricatorPolicyInterface
,
PhabricatorApplicationTransactionInterface
{
protected
$name
;
protected
$mailKey
;
protected
$viewPolicy
;
protected
$editPolicy
;
protected
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_AUX_PHID
=>
true
,
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'name'
=>
'text255?'
,
'mailKey'
=>
'bytes20'
,
),
)
+
parent
::
getConfiguration
();
}
public
function
generatePHID
()
{
return
PhabricatorPHID
::
generateNewPHID
(
NuanceQueuePHIDType
::
TYPECONST
);
}
public
static
function
initializeNewQueue
()
{
return
id
(
new
self
())
->
setViewPolicy
(
PhabricatorPolicies
::
POLICY_USER
)
->
setEditPolicy
(
PhabricatorPolicies
::
POLICY_USER
);
}
public
function
save
()
{
if
(!
$this
->
getMailKey
())
{
$this
->
setMailKey
(
Filesystem
::
readRandomCharacters
(
20
));
}
return
parent
::
save
();
}
public
function
getURI
()
{
return
'/nuance/queue/view/'
.
$this
->
getID
().
'/'
;
}
public
function
getWorkURI
()
{
return
'/nuance/queue/work/'
.
$this
->
getID
().
'/'
;
}
/* -( 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
$this
->
getEditPolicy
();
}
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
false
;
}
/* -( PhabricatorApplicationTransactionInterface )------------------------- */
public
function
getApplicationTransactionEditor
()
{
return
new
NuanceQueueEditor
();
}
public
function
getApplicationTransactionObject
()
{
return
$this
;
}
public
function
getApplicationTransactionTemplate
()
{
return
new
NuanceQueueTransaction
();
}
public
function
willRenderTimeline
(
PhabricatorApplicationTransactionView
$timeline
,
AphrontRequest
$request
)
{
return
$timeline
;
}
}
Event Timeline
Log In to Comment