MINOR Throw an InvalidArguementException if invalid method is called.

This commit is contained in:
Simon Elvery 2012-11-13 16:01:29 +10:00
parent 0702e8902b
commit cae56255a5

View File

@ -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));
}
}