Back to AdminModel class

Method generateTitle

public void
generateTitle
(mixed $categoryId, mixed $table)
A method to preprocess generating a new title in order to allow tables with alternative names for alias and title to use the batch move and copy methods
Parameters
  • int $categoryId The target category id
  • \Joomla\CMS\Table\Table $table The Table within which move or copy is taking place
Returns
  • void
Since
  • 3.2
Class: AdminModel
Project: Joomla

Method generateTitle - Source code

/**
 * A method to preprocess generating a new title in order to allow tables with alternative names
 * for alias and title to use the batch move and copy methods
 *
 * @param   integer  $categoryId  The target category id
 * @param   Table    $table       The Table within which move or copy is taking place
 *
 * @return  void
 *
 * @since   3.2
 */
public function generateTitle($categoryId, $table)
{
    // Alter the title & alias
    $titleField = $table->getColumnAlias('title');
    $aliasField = $table->getColumnAlias('alias');
    $data = $this->generateNewTitle($categoryId, $table->{$aliasField}, $table->{$titleField});
    $table->{$titleField} = $data['0'];
    $table->{$aliasField} = $data['1'];
}