From f23c07414336d9ea56d56cc847ce1e5e4a01358c Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sat, 5 Mar 2016 17:04:38 +0100 Subject: [PATCH] DataTypeHook: also add getSetting helper method --- library/Director/Hook/DataTypeHook.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/library/Director/Hook/DataTypeHook.php b/library/Director/Hook/DataTypeHook.php index 3ed41dc3..3583fdc0 100644 --- a/library/Director/Hook/DataTypeHook.php +++ b/library/Director/Hook/DataTypeHook.php @@ -40,4 +40,13 @@ abstract class DataTypeHook $this->settings = $settings; return $this; } + + public function getSetting($name, $default = null) + { + if (array_key_exists($name, $this->settings)) { + return $this->settings[$name]; + } else { + return $default; + } + } }