Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101332935
AlmanacNamespaceEditor.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
Fri, Feb 7, 20:50
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Feb 9, 20:50 (2 d)
Engine
blob
Format
Raw Data
Handle
24134116
Attached To
rPH Phabricator
AlmanacNamespaceEditor.php
View Options
<?php
final
class
AlmanacNamespaceEditor
extends
AlmanacEditor
{
public
function
getEditorObjectsDescription
()
{
return
pht
(
'Almanac Namespace'
);
}
public
function
getCreateObjectTitle
(
$author
,
$object
)
{
return
pht
(
'%s created this namespace.'
,
$author
);
}
public
function
getCreateObjectTitleForFeed
(
$author
,
$object
)
{
return
pht
(
'%s created %s.'
,
$author
,
$object
);
}
protected
function
supportsSearch
()
{
return
true
;
}
public
function
getTransactionTypes
()
{
$types
=
parent
::
getTransactionTypes
();
$types
[]
=
PhabricatorTransactions
::
TYPE_VIEW_POLICY
;
$types
[]
=
PhabricatorTransactions
::
TYPE_EDIT_POLICY
;
return
$types
;
}
protected
function
didCatchDuplicateKeyException
(
PhabricatorLiskDAO
$object
,
array
$xactions
,
Exception
$ex
)
{
$errors
=
array
();
$errors
[]
=
new
PhabricatorApplicationTransactionValidationError
(
null
,
pht
(
'Invalid'
),
pht
(
'Another namespace with this name already exists. Each namespace '
.
'must have a unique name.'
),
null
);
throw
new
PhabricatorApplicationTransactionValidationException
(
$errors
);
}
}
Event Timeline
Log In to Comment