From a395f9a9f74b543220bd2c16d63d66953d6e731c Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Tue, 3 Mar 2015 09:25:02 -0500 Subject: [PATCH] Add find method for returning hash of Config table --- web/api/app/Model/Config.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/api/app/Model/Config.php b/web/api/app/Model/Config.php index 5d3ce852c..d83728c76 100644 --- a/web/api/app/Model/Config.php +++ b/web/api/app/Model/Config.php @@ -27,4 +27,16 @@ class Config extends AppModel { */ public $displayField = 'Value'; + + // Add a find method for returning a hash of the Config table. + // This is used for the Options view. + public $findMethods = array('hash' => true); + protected function _findHash($state, $query, $results = array()) { + if ($state === 'before') { + return $query; + } + $results = Set::combine($results, '{n}.Config.Name', '{n}.Config'); + return $results; + } + }