summaryrefslogtreecommitdiff
path: root/app/Model/Base.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-10-03 18:22:06 -0400
committerFrederic Guillot <fred@kanboard.net>2015-10-03 18:22:06 -0400
commitc9e317872004cdd7e58a9474d17a1b85888c5873 (patch)
tree5f21bd427d12a65c9b0577c50ca1bee94bfdee44 /app/Model/Base.php
parent260c8515c507b8c339fdbe1a10b0f13792eac09d (diff)
Fix issue when unlinking Gitlab account
Diffstat (limited to 'app/Model/Base.php')
-rw-r--r--app/Model/Base.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/Model/Base.php b/app/Model/Base.php
index a15f071c..902ab269 100644
--- a/app/Model/Base.php
+++ b/app/Model/Base.php
@@ -97,6 +97,22 @@ abstract class Base extends \Core\Base
}
/**
+ * Force some fields to be null if empty
+ *
+ * @access public
+ * @param array $values Input array
+ * @param string[] $keys List of keys
+ */
+ public function convertNullFields(array &$values, array $keys)
+ {
+ foreach ($keys as $key) {
+ if (array_key_exists($key, $values) && empty($values[$key])) {
+ $values[$key] = null;
+ }
+ }
+ }
+
+ /**
* Build SQL condition for a given time range
*
* @access protected