Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F547239
PhabricatorDashboardQueryPanelLimitTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
892 B
Referenced Files
None
Subscribers
None
PhabricatorDashboardQueryPanelLimitTransaction.php
View Options
<?php
final
class
PhabricatorDashboardQueryPanelLimitTransaction
extends
PhabricatorDashboardPanelPropertyTransaction
{
const
TRANSACTIONTYPE
=
'search.limit'
;
protected
function
getPropertyKey
()
{
return
'limit'
;
}
public
function
generateNewValue
(
$object
,
$value
)
{
if
(!
$value
)
{
return
null
;
}
return
$value
;
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
$old_value
=
$object
->
getProperty
(
$this
->
getPropertyKey
());
foreach
(
$xactions
as
$xaction
)
{
$new_value
=
$xaction
->
getNewValue
();
if
(
$new_value
===
$old_value
)
{
continue
;
}
if
(
$new_value
<
0
)
{
$errors
[]
=
$this
->
newInvalidError
(
pht
(
'Query result limit must be empty, or at least 1.'
),
$xaction
);
continue
;
}
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:30 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
122811
Default Alt Text
PhabricatorDashboardQueryPanelLimitTransaction.php (892 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment