X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FType.php;h=6a2bf762067a33e5c3c8ae65c801a6104d645843;hb=ee73cf301e0996ec4e5fea742446f4c09343cad1;hp=db7b0ea2d42f3405c6d81b5e8e1045e04a1c0b67;hpb=6c6872a8ee5acec3dba231fe2231c610241302eb;p=civicrm-core.git diff --git a/CRM/Utils/Type.php b/CRM/Utils/Type.php index db7b0ea2d4..6a2bf76206 100644 --- a/CRM/Utils/Type.php +++ b/CRM/Utils/Type.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.7 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2016 | + | Copyright CiviCRM LLC (c) 2004-2017 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -28,7 +28,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2016 + * @copyright CiviCRM LLC (c) 2004-2017 */ class CRM_Utils_Type { const @@ -49,7 +49,10 @@ class CRM_Utils_Type { T_CCNUM = 8192, T_MEDIUMBLOB = 16384; - // @todo What's the point of these constants? Backwards compatibility? + // @TODO What's the point of these constants? Backwards compatibility? + // + // These are used for field size (), but redundant TWO=2 + // usages are rare and should be eliminated. See CRM-18810. const TWO = 2, FOUR = 4, @@ -453,4 +456,22 @@ class CRM_Utils_Type { return $output; } + /** + * Get list of avaliable Data Tupes for Option Groups + * + * @return array + */ + public static function dataTypes() { + $types = array( + 'Integer', + 'String', + 'Date', + 'Time', + 'Timestamp', + 'Money', + 'Email', + ); + return array_combine($types, $types); + } + }