Skip to content
Snippets Groups Projects
Commit 2a8b0bd8 authored by Peter Rotich's avatar Peter Rotich
Browse files

Check primary properties first to avoid uncessesary config loading

parent b42ce54d
No related branches found
No related tags found
No related merge requests found
...@@ -69,16 +69,17 @@ implements AuthenticatedUser, EmailContact, TemplateVariable, Searchable { ...@@ -69,16 +69,17 @@ implements AuthenticatedUser, EmailContact, TemplateVariable, Searchable {
function get($field, $default=false) { function get($field, $default=false) {
// Check primary fields
try {
return parent::get($field, $default);
} catch (Exception $e) {}
// Autoload config if not loaded already // Autoload config if not loaded already
if (!isset($this->_config)) if (!isset($this->_config))
$this->getConfig(); $this->getConfig();
if (isset($this->_config[$field])) if (isset($this->_config[$field]))
return $this->_config[$field]; return $this->_config[$field];
try {
return parent::get($field, $default);
} catch (Exception $e) {}
} }
function getConfig() { function getConfig() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment