Added translateBooleanToYesNo().
authorRoland Haeder <roland@mxchange.org>
Thu, 20 Mar 2014 20:35:39 +0000 (21:35 +0100)
committerRoland Haeder <roland@mxchange.org>
Thu, 20 Mar 2014 20:35:39 +0000 (21:35 +0100)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/main/class_BaseFrameworkSystem.php

index 01a280da02ee32b936ceec5632c492c303ae986e..78cdde3f367828f3e4f7cf12e015b9b3e5e3e561 100644 (file)
@@ -2714,6 +2714,23 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Return it
                return $isValid;
        }
                // Return it
                return $isValid;
        }
+
+       /**
+        * Translates boolean TRUE to 'Y' and FALSE to 'N'
+        *
+        * @param       $boolean                Boolean value
+        * @return      $translated             Translated boolean value
+        */
+       public static final function translateBooleanToYesNo ($boolean) {
+               // Make sure it is really boolean
+               assert(is_bool($boolean));
+
+               // "Translate" it
+               $translated = ($boolean === TRUE) ? 'Y' : 'N';
+
+               // ... and return it
+               return $translated;
+       }
 }
 
 // [EOF]
 }
 
 // [EOF]