Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

returning true on successful save

  • Loading branch information...
commit d009cf72d9a0ea4b90ec2529d867062a3c3ad347 1 parent be602ae
siran authored April 11, 2012

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

  1. 4  models/behaviors/keyvalue.php
4  models/behaviors/keyvalue.php
@@ -81,6 +81,7 @@ public function getSection($Model, $foreignKey = null, $section = null) {
81 81
  * @var string
82 82
  */
83 83
 	public function saveSection($Model, $foreignKey = null, $data = null, $section = null) {
  84
+		$saved = true;
84 85
 		foreach($data as $model => $details) {
85 86
 			foreach($details as $key => $value) {
86 87
 				$newDetail = array();
@@ -98,8 +99,9 @@ public function saveSection($Model, $foreignKey = null, $data = null, $section =
98 99
 				$newDetail[$Model->alias][$this->settings[$Model->alias]['foreignKey']] = $foreignKey;
99 100
 				$newDetail[$Model->alias]['field'] = $section . '.' . $key;
100 101
 				$newDetail[$Model->alias]['value'] = $value;
101  
-				$Model->save($newDetail);
  102
+				$saved = $saved && $Model->save($newDetail);
102 103
 			}
103 104
 		}
  105
+		return $saved;
104 106
 	}
105 107
 }

0 notes on commit d009cf7

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