|
@@ -108,7 +108,7 @@ class ResetBehavior extends ModelBehavior {
|
|
|
set_time_limit(max($max, $count / $limit));
|
|
set_time_limit(max($max, $count / $limit));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $modifed = 0;
|
|
|
|
|
|
|
+ $modified = 0;
|
|
|
while ($rows = $Model->find('all', $params)) {
|
|
while ($rows = $Model->find('all', $params)) {
|
|
|
foreach ($rows as $row) {
|
|
foreach ($rows as $row) {
|
|
|
$Model->create();
|
|
$Model->create();
|
|
@@ -136,14 +136,14 @@ class ResetBehavior extends ModelBehavior {
|
|
|
if (!$res) {
|
|
if (!$res) {
|
|
|
throw new CakeException(print_r($Model->validationErrors, true));
|
|
throw new CakeException(print_r($Model->validationErrors, true));
|
|
|
}
|
|
}
|
|
|
- $modifed++;
|
|
|
|
|
|
|
+ $modified++;
|
|
|
}
|
|
}
|
|
|
$params['page']++;
|
|
$params['page']++;
|
|
|
if ($timeout) {
|
|
if ($timeout) {
|
|
|
sleep((int)$timeout);
|
|
sleep((int)$timeout);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return $modifed;
|
|
|
|
|
|
|
+ return $modified;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|