Add find method for returning hash of Config table
This commit is contained in:
parent
a4c5f83c8c
commit
a395f9a9f7
|
@ -27,4 +27,16 @@ class Config extends AppModel {
|
||||||
*/
|
*/
|
||||||
public $displayField = 'Value';
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue