Merge pull request #8783 from open-sausages/pulls/4/docs-dataobject-update

DOC Clarify DataObject->update() use
This commit is contained in:
Guy Marriott 2019-02-04 21:45:13 +13:00 committed by GitHub
commit b2e18dda9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -947,9 +947,12 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
* The field names can be simple names, or you can use a dot syntax to access $has_one relations.
* For example, array("Author.FirstName" => "Jim") will set $this->Author()->FirstName to "Jim".
*
* update() doesn't write the main object, but if you use the dot syntax, it will write()
* Doesn't write the main object, but if you use the dot syntax, it will write()
* the related objects that it alters.
*
* When using this method with user supplied data, it's very important to
* whitelist the allowed keys.
*
* @param array $data A map of field name to data values to update.
* @return DataObject $this
*/