projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb005a0
)
Backport validateAll function to 4.6
author
Seamus Lee
<seamuslee001@gmail.com>
Fri, 18 Nov 2016 22:31:17 +0000
(09:31 +1100)
committer
Seamus Lee
<seamuslee001@gmail.com>
Fri, 18 Nov 2016 22:31:17 +0000
(09:31 +1100)
CRM/Utils/Type.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Utils/Type.php
b/CRM/Utils/Type.php
index c1bd663f9c68693dd4e771c24209e7335a376bad..038d49713e6b7b9c07a3a213f5042adf8c1fb5ac 100644
(file)
--- a/
CRM/Utils/Type.php
+++ b/
CRM/Utils/Type.php
@@
-299,6
+299,18
@@
class CRM_Utils_Type {
return NULL;
}
+ /**
+ * Helper function to call validate on arrays
+ *
+ * @see validate
+ */
+ public static function validateAll($data, $type, $abort = TRUE) {
+ foreach ($data as $key => $value) {
+ $data[$key] = CRM_Utils_Type::validate($value, $type, $abort);
+ }
+ return $data;
+ }
+
/**
* Verify that a variable is of a given type.
*