From eab7e4a21aabf04fa0bac76203122460cc79817e Mon Sep 17 00:00:00 2001
From: Qiang Xue <qiang.xue@gmail.com>
Date: Tue, 10 Dec 2013 18:17:24 -0500
Subject: [PATCH] Added $formName to Model::load().

---
 framework/yii/base/Model.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/framework/yii/base/Model.php b/framework/yii/base/Model.php
index 22849b2..ba51ec7 100644
--- a/framework/yii/base/Model.php
+++ b/framework/yii/base/Model.php
@@ -714,11 +714,13 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
 	 * The data being populated is subject to the safety check by [[setAttributes()]].
 	 * @param array $data the data array. This is usually `$_POST` or `$_GET`, but can also be any valid array
 	 * supplied by end user.
+	 * @param string $formName the form name to be used for loading the data into the model.
+	 * If not set, [[formName()]] will be used.
 	 * @return boolean whether the model is successfully populated with some data.
 	 */
-	public function load($data)
+	public function load($data, $formName = null)
 	{
-		$scope = $this->formName();
+		$scope = $formName === null ? $this->formName() : $formName;
 		if ($scope == '') {
 			$this->setAttributes($data);
 			return true;
--
libgit2 0.27.1