Back to Table class

Method getColumnAlias

public string
getColumnAlias
(mixed $column)
Method to return the real name of a "special" column such as ordering, hits, published etc etc. In this way you are free to follow your db naming convention and use the built in \Joomla functions.
Parameters
  • string $column Name of the "special" column (ie ordering, hits)
Returns
  • string The string that identify the special
Since
  • 3.4
Class: Table
Project: Joomla

Method getColumnAlias - Source code

/**
 * Method to return the real name of a "special" column such as ordering, hits, published
 * etc etc. In this way you are free to follow your db naming convention and use the
 * built in \Joomla functions.
 *
 * @param   string  $column  Name of the "special" column (ie ordering, hits)
 *
 * @return  string  The string that identify the special
 *
 * @since   3.4
 */
public function getColumnAlias($column)
{
    // Get the column data if set
    if (isset($this->_columnAlias[$column])) {
        $return = $this->_columnAlias[$column];
    } else {
        $return = $column;
    }
    // Sanitize the name
    $return = preg_replace('#[^A-Z0-9_]#i', '', $return);
    return $return;
}