From cae56255a575dca7000d670fd9eeb4fa1e32e08b Mon Sep 17 00:00:00 2001 From: Simon Elvery Date: Tue, 13 Nov 2012 16:01:29 +1000 Subject: [PATCH] MINOR Throw an InvalidArguementException if invalid method is called. --- code/model/Translatable.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/model/Translatable.php b/code/model/Translatable.php index c917a46..18b19f6 100755 --- a/code/model/Translatable.php +++ b/code/model/Translatable.php @@ -929,6 +929,8 @@ class Translatable extends DataExtension implements PermissionProvider { function applyTranslatableFieldsUpdate($fields, $type) { if (method_exists($this, $type)) { $this->$type($fields); + } else { + throw new InvalidArgumentException("Method $type does not exist on object of type ". get_class($this)); } }