Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99049993
PhabricatorProjectLockTransaction.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, Jan 18, 17:44
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jan 20, 17:44 (2 d)
Engine
blob
Format
Raw Data
Handle
23697609
Attached To
rPH Phabricator
PhabricatorProjectLockTransaction.php
View Options
<?php
final
class
PhabricatorProjectLockTransaction
extends
PhabricatorProjectTransactionType
{
const
TRANSACTIONTYPE
=
'project:locked'
;
public
function
generateOldValue
(
$object
)
{
return
(
int
)
$object
->
getIsMembershipLocked
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setIsMembershipLocked
(
$value
);
}
public
function
getTitle
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
)
{
return
pht
(
"%s locked this project's membership."
,
$this
->
renderAuthor
());
}
else
{
return
pht
(
"%s unlocked this project's membership."
,
$this
->
renderAuthor
());
}
}
public
function
getTitleForFeed
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
)
{
return
pht
(
'%s locked %s membership.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
else
{
return
pht
(
'%s unlocked %s membership.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
public
function
getIcon
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
)
{
return
'fa-lock'
;
}
else
{
return
'fa-unlock'
;
}
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
if
(
$xactions
)
{
$this
->
requireApplicationCapability
(
ProjectCanLockProjectsCapability
::
CAPABILITY
);
}
return
array
();
}
}
Event Timeline
Log In to Comment