Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95998219
PhabricatorSpacesNamespace.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, Dec 21, 14:09
Size
2 KB
Mime Type
text/x-php
Expires
Mon, Dec 23, 14:09 (2 d)
Engine
blob
Format
Raw Data
Handle
23099474
Attached To
rPH Phabricator
PhabricatorSpacesNamespace.php
View Options
<?php
final
class
PhabricatorSpacesNamespace
extends
PhabricatorSpacesDAO
implements
PhabricatorPolicyInterface
,
PhabricatorApplicationTransactionInterface
,
PhabricatorDestructibleInterface
{
protected
$namespaceName
;
protected
$viewPolicy
;
protected
$editPolicy
;
protected
$isDefaultNamespace
;
public
static
function
initializeNewNamespace
(
PhabricatorUser
$actor
)
{
$app
=
id
(
new
PhabricatorApplicationQuery
())
->
setViewer
(
$actor
)
->
withClasses
(
array
(
'PhabricatorApplicationSpaces'
))
->
executeOne
();
$view_policy
=
$app
->
getPolicy
(
PhabricatorSpacesCapabilityDefaultView
::
CAPABILITY
);
$edit_policy
=
$app
->
getPolicy
(
PhabricatorSpacesCapabilityDefaultEdit
::
CAPABILITY
);
return
id
(
new
PhabricatorSpacesNamespace
())
->
setIsDefaultNamespace
(
null
)
->
setViewPolicy
(
$view_policy
)
->
setEditPolicy
(
$edit_policy
);
}
public
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_AUX_PHID
=>
true
,
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'namespaceName'
=>
'text255'
,
'isDefaultNamespace'
=>
'bool?'
,
),
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'key_default'
=>
array
(
'columns'
=>
array
(
'isDefaultNamespace'
),
'unique'
=>
true
,
),
),
)
+
parent
::
getConfiguration
();
}
public
function
generatePHID
()
{
return
PhabricatorPHID
::
generateNewPHID
(
PhabricatorSpacesNamespacePHIDType
::
TYPECONST
);
}
public
function
getMonogram
()
{
return
'S'
.
$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
;
}
public
function
describeAutomaticCapability
(
$capability
)
{
return
null
;
}
/* -( PhabricatorApplicationTransactionInterface )------------------------- */
public
function
getApplicationTransactionEditor
()
{
return
new
PhabricatorSpacesNamespaceEditor
();
}
public
function
getApplicationTransactionObject
()
{
return
$this
;
}
public
function
getApplicationTransactionTemplate
()
{
return
new
PhabricatorSpacesNamespaceTransaction
();
}
public
function
willRenderTimeline
(
PhabricatorApplicationTransactionView
$timeline
,
AphrontRequest
$request
)
{
return
$timeline
;
}
/* -( PhabricatorDestructibleInterface )----------------------------------- */
public
function
destroyObjectPermanently
(
PhabricatorDestructionEngine
$engine
)
{
$this
->
delete
();
}
}
Event Timeline
Log In to Comment