Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/search/storage/PhabricatorNamedQuery.php b/src/applications/search/storage/PhabricatorNamedQuery.php
index 154e6d9b18..3df30cc229 100644
--- a/src/applications/search/storage/PhabricatorNamedQuery.php
+++ b/src/applications/search/storage/PhabricatorNamedQuery.php
@@ -1,64 +1,64 @@
<?php
final class PhabricatorNamedQuery extends PhabricatorSearchDAO
implements PhabricatorPolicyInterface {
protected $queryKey;
protected $queryName;
protected $userPHID;
protected $engineClassName;
protected $isBuiltin = 0;
protected $isDisabled = 0;
protected $sequence = 0;
public function getConfiguration() {
return array(
self::CONFIG_COLUMN_SCHEMA => array(
'engineClassName' => 'text128',
'queryName' => 'text255',
- 'queryKey' => 'bytes12',
+ 'queryKey' => 'text12',
'isBuiltin' => 'bool',
'isDisabled' => 'bool',
'sequence' => 'uint32',
),
self::CONFIG_KEY_SCHEMA => array(
'key_userquery' => array(
'columns' => array('userPHID', 'engineClassName', 'queryKey'),
'unique' => true,
),
),
) + parent::getConfiguration();
}
public function getSortKey() {
return sprintf('~%010d%010d', $this->sequence, $this->getID());
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public function getCapabilities() {
return array(
PhabricatorPolicyCapability::CAN_VIEW,
);
}
public function getPolicy($capability) {
return PhabricatorPolicies::POLICY_NOONE;
}
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
if ($viewer->getPHID() == $this->userPHID) {
return true;
}
return false;
}
public function describeAutomaticCapability($capability) {
return pht(
'The queries you have saved are private. Only you can view or edit '.
'them.');
}
}
diff --git a/src/applications/search/storage/PhabricatorSavedQuery.php b/src/applications/search/storage/PhabricatorSavedQuery.php
index eb6b29597c..a8e8456e2a 100644
--- a/src/applications/search/storage/PhabricatorSavedQuery.php
+++ b/src/applications/search/storage/PhabricatorSavedQuery.php
@@ -1,77 +1,77 @@
<?php
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,
),
self::CONFIG_COLUMN_SCHEMA => array(
'engineClassName' => 'text255',
- 'queryKey' => 'bytes12',
+ 'queryKey' => 'text12',
),
self::CONFIG_KEY_SCHEMA => array(
'key_queryKey' => array(
'columns' => array('queryKey'),
'unique' => true,
),
),
) + 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;
}
public function describeAutomaticCapability($capability) {
return null;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Apr 29, 4:03 AM (21 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
108186
Default Alt Text
(4 KB)

Event Timeline