Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Chainable Form->loadDataFrom()

  • Loading branch information...
commit e2c1deb4f71cb8a8f2c1ad45e0be2ec272167c1f 1 parent a4bce3f
unclecheese unclecheese authored chillu committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 forms/Form.php
5 forms/Form.php
View
@@ -1091,11 +1091,12 @@ function validate(){
* 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 @@ public function loadDataFrom($data, $clearMissingFields = false, $fieldList = nu
$field->setValue($val, $data);
}
}
+
+ return $this;
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.