public function slug($entity, $string = null, $separator = null)
    {
        if ($separator === null) {
            $separator = $this->getConfig('separator');
        }

        if (is_string($entity)) {
            if ($string !== null) {
                $separator = $string;
            }
            $string = $entity;
            unset($entity);
        } elseif (($entity instanceof Entity) && $string === null) {
            $string = $this->_getSlugStringFromEntity($entity, $separator);
        }

        $slug = $this->_slug($string, $separator);

        $unique = $this->getConfig('unique');
        if (isset($entity) && $unique) {
            $slug = $unique($entity, $slug, $separator);
        }

        return $slug;
    }