public function generatePublicAlias($subject, $currentAlias = '')
    {
        if (is_object($subject)) {
            if ($subject instanceof Aliasable) {
                $subject = (string)$subject->getAliasTitle();
            } elseif (method_exists($subject, 'getTitle')) {
                $subject = (string)$subject->getTitle();
            } else {
                $subject = (string)$subject;
            }
        }
        if (!is_string($subject)) {
            throw new \InvalidArgumentException('Expected a string or object as subject, got ' . gettype($subject));
        }

        if ($alias = $this->toAlias($subject)) {
            return $this->basePath . $alias;
        }
        return null;
    }