Skip to content
This repository
Browse code

MINOR Chainable Form->loadDataFrom()

  • Loading branch information...
commit e2c1deb4f71cb8a8f2c1ad45e0be2ec272167c1f 1 parent a4bce3f
unclecheese authored June 20, 2012 chillu committed June 20, 2012

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  forms/Form.php
5  forms/Form.php
@@ -1091,11 +1091,12 @@ function validate(){
1091 1091
 	 *  those fields are overwritten with null regardless if they have a match in {@link $data}.
1092 1092
 	 * @param $fieldList An optional list of fields to process.  This can be useful when you have a 
1093 1093
 	 * form that has some fields that save to one object, and some that save to another.
  1094
+	 * @return Form
1094 1095
 	 */
1095 1096
 	public function loadDataFrom($data, $clearMissingFields = false, $fieldList = null) {
1096 1097
 		if(!is_object($data) && !is_array($data)) {
1097 1098
 			user_error("Form::loadDataFrom() not passed an array or an object", E_USER_WARNING);
1098  
-			return false;
  1099
+			return $this;
1099 1100
 		}
1100 1101
 
1101 1102
 		// if an object is passed, save it for historical reference through {@link getRecord()}
@@ -1145,6 +1146,8 @@ public function loadDataFrom($data, $clearMissingFields = false, $fieldList = nu
1145 1146
 				$field->setValue($val, $data);
1146 1147
 			}
1147 1148
 		}
  1149
+
  1150
+		return $this;
1148 1151
 	}
1149 1152
 	
1150 1153
 	/**

0 notes on commit e2c1deb

Please sign in to comment.
Something went wrong with that request. Please try again.