From e2c1deb4f71cb8a8f2c1ad45e0be2ec272167c1f Mon Sep 17 00:00:00 2001 From: unclecheese Date: Wed, 20 Jun 2012 17:01:16 +0200 Subject: [PATCH] MINOR Chainable Form->loadDataFrom() --- forms/Form.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/forms/Form.php b/forms/Form.php index 3d8031a99..150f67ead 100644 --- a/forms/Form.php +++ b/forms/Form.php @@ -1091,11 +1091,12 @@ class Form extends RequestHandler { * those fields are overwritten with null regardless if they have a match in {@link $data}. * @param $fieldList An optional list of fields to process. This can be useful when you have a * form that has some fields that save to one object, and some that save to another. + * @return Form */ public function loadDataFrom($data, $clearMissingFields = false, $fieldList = null) { if(!is_object($data) && !is_array($data)) { user_error("Form::loadDataFrom() not passed an array or an object", E_USER_WARNING); - return false; + return $this; } // if an object is passed, save it for historical reference through {@link getRecord()} @@ -1145,6 +1146,8 @@ class Form extends RequestHandler { $field->setValue($val, $data); } } + + return $this; } /**