/**
* Method to change the title & alias.
*
* @param integer $categoryId The id of the category.
* @param string $alias The alias.
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
* @since 1.7
*/
protected function generateNewTitle($categoryId, $alias, $title)
{
// Alter the title & alias
$table = $this->getTable();
$aliasField = $table->getColumnAlias('alias');
$catidField = $table->getColumnAlias('catid');
$titleField = $table->getColumnAlias('title');
while ($table->load(array($aliasField => $alias, $catidField => $categoryId))) {
if ($title === $table->{$titleField}) {
$title = StringHelper::increment($title);
}
$alias = StringHelper::increment($alias, 'dash');
}
return array($title, $alias);
}