Code Duplication    Length = 7-8 lines in 2 locations

lib/Cake/Model/Model.php 2 locations

@@ 2219-2225 (lines=7) @@
2216
			return !empty($result);
2217
		}
2218
2219
		if ($options['validate'] === 'first') {
2220
			$validates = $this->validateMany($data, $options);
2221
			if ((!$validates && $options['atomic']) || (!$options['atomic'] && in_array(false, $validates, true))) {
2222
				return $validates;
2223
			}
2224
			$options['validate'] = false;
2225
		}
2226
2227
		if ($options['atomic']) {
2228
			$db = $this->getDataSource();
@@ 2341-2348 (lines=8) @@
2338
			return !empty($result);
2339
		}
2340
2341
		if ($options['validate'] === 'first') {
2342
			$validates = $this->validateAssociated($data, $options);
2343
			if ((!$validates && $options['atomic']) || (!$options['atomic'] && in_array(false, Hash::flatten($validates), true))) {
2344
				return $validates;
2345
			}
2346
2347
			$options['validate'] = false;
2348
		}
2349
2350
		if ($options['atomic']) {
2351
			$db = $this->getDataSource();