Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F554938
PhabricatorProjectColumnLimitTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorProjectColumnLimitTransaction.php
View Options
<?php
final
class
PhabricatorProjectColumnLimitTransaction
extends
PhabricatorProjectColumnTransactionType
{
const
TRANSACTIONTYPE
=
'project:col:limit'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getPointLimit
();
}
public
function
generateNewValue
(
$object
,
$value
)
{
if
(
strlen
(
$value
))
{
return
(
int
)
$value
;
}
else
{
return
null
;
}
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setPointLimit
(
$value
);
}
public
function
getTitle
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
if
(!
$old
)
{
return
pht
(
'%s set the point limit for this column to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderNewValue
());
}
else
if
(!
$new
)
{
return
pht
(
'%s removed the point limit for this column.'
,
$this
->
renderAuthor
());
}
else
{
return
pht
(
'%s changed the point limit for this column from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderOldValue
(),
$this
->
renderNewValue
());
}
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
foreach
(
$xactions
as
$xaction
)
{
$value
=
$xaction
->
getNewValue
();
if
(
strlen
(
$value
)
&&
!
preg_match
(
'/^
\d
+
\z
/'
,
$value
))
{
$errors
[]
=
$this
->
newInvalidError
(
pht
(
'Column point limit must either be empty or a nonnegative '
.
'integer.'
),
$xaction
);
}
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 6:19 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
124633
Default Alt Text
PhabricatorProjectColumnLimitTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment