Skip to content

Commit 6dd9f16

Browse files
author
Mark Scherer
committed
Fix up doc blocks and dont use deprecated methods.
1 parent bfd3f8c commit 6dd9f16

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Model/Behavior/SluggedBehavior.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ public function generateSlug(Model $Model) {
212212
}
213213
if (isset($Model->data[$alias][$field])) {
214214
if (is_array($Model->data[$alias][$field])) {
215-
return $this->_multiSlug($Model);
215+
$this->_multiSlug($Model);
216+
return;
216217
}
217218
$slug[] = $Model->data[$alias][$field];
218219
} elseif ($Model->id) {
@@ -306,7 +307,7 @@ public function slug(Model $Model, $string, $tidy = true) {
306307
$i = 0;
307308
$suffix = '';
308309

309-
while ($Model->hasAny($conditions)) {
310+
while ((bool)$Model->find('count', ['conditions' => $conditions, 'recursive' => -1])) {
310311
$i++;
311312
$suffix = $separator . $i;
312313
if ($length && strlen($slug . $suffix) > $length) {
@@ -381,8 +382,7 @@ public function display(Model $Model, $id = null) {
381382
* limit is set to allow a minimum 100 updates per second as a preventative measure.
382383
*
383384
* @param AppModel $Model
384-
* @param array $conditions
385-
* @param int $recursive
385+
* @param array $params
386386
* @return bool Success
387387
*/
388388
public function resetSlugs(Model $Model, $params = []) {
@@ -458,7 +458,7 @@ protected function _multiSlug(Model $Model) {
458458
* @param mixed $replace
459459
* @param mixed $string
460460
* @param string $encoding
461-
* @return void
461+
* @return string
462462
*/
463463
protected function _pregReplace($pattern, $replace, $string, $encoding = 'UTF-8') {
464464
if ($encoding && $encoding !== 'UTF-8') {

0 commit comments

Comments
 (0)