framework/behaviors/SluggableBehavior.php
protected function makeUnique($slug)
    {
        $uniqueSlug = $slug;
        $iteration = 0;
        while (!$this->validateSlug($uniqueSlug)) {
            $iteration++;
            $uniqueSlug = $this->generateUniqueSlug($slug, $iteration);
        }

        return $uniqueSlug;
    }
protected function makeUnique($slug)
    {
        $uniqueSlug = $slug;
        $iteration = 0;
        while (!$this->validateSlug($uniqueSlug)) {
            $iteration++;
            $uniqueSlug = $this->generateUniqueSlug($slug, $iteration);
        }

        return $uniqueSlug;
    }
This method is called by [[getValue]] when [[ensureUnique]] is true to generate the unique slug.
Calls [[generateUniqueSlug]] until generated slug is unique and returns it.
@param string $slug basic slug value
@return string unique slug
@see getValue
@see generateUniqueSlug
@since 2.0.7