Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96156467
PhabricatorSavedQuery.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
Mon, Dec 23, 06:47
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 25, 06:47 (2 d)
Engine
blob
Format
Raw Data
Handle
23134922
Attached To
rPH Phabricator
PhabricatorSavedQuery.php
View Options
<?php
/**
* @group search
*/
final
class
PhabricatorSavedQuery
extends
PhabricatorSearchDAO
implements
PhabricatorPolicyInterface
{
protected
$parameters
=
array
();
protected
$queryKey
;
protected
$engineClassName
;
public
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_SERIALIZATION
=>
array
(
'parameters'
=>
self
::
SERIALIZATION_JSON
,
),
)
+
parent
::
getConfiguration
();
}
public
function
setParameter
(
$key
,
$value
)
{
$this
->
parameters
[
$key
]
=
$value
;
return
$this
;
}
public
function
getParameter
(
$key
,
$default
=
null
)
{
return
idx
(
$this
->
parameters
,
$key
,
$default
);
}
public
function
save
()
{
if
(
$this
->
getEngineClassName
()
===
null
)
{
throw
new
Exception
(
pht
(
"Engine class is null."
));
}
// Instantiate the engine to make sure it's valid.
$this
->
newEngine
();
$serial
=
$this
->
getEngineClassName
().
serialize
(
$this
->
parameters
);
$this
->
queryKey
=
PhabricatorHash
::
digestForIndex
(
$serial
);
return
parent
::
save
();
}
public
function
newEngine
()
{
return
newv
(
$this
->
getEngineClassName
(),
array
());
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
);
}
public
function
getPolicy
(
$capability
)
{
return
PhabricatorPolicies
::
POLICY_PUBLIC
;
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
false
;
}
}
Event Timeline
Log In to Comment