Back to UCMType class

Method getTypeByAlias

public object
getTypeByAlias
(mixed $typeAlias = null)
Get the Content Type from the alias
Parameters
  • string $typeAlias The alias for the type
Returns
  • object The UCM Type data
Since
  • 3.2
Class: UCMType
Project: Joomla

Method getTypeByAlias - Source code

/**
 * Get the Content Type from the alias
 *
 * @param   string  $typeAlias  The alias for the type
 *
 * @return  object  The UCM Type data
 *
 * @since   3.2
 */
public function getTypeByAlias($typeAlias = null)
{
    $query = $this->db->getQuery(true)->select($this->db->quoteName('ct') . '.*')->from($this->db->quoteName('#__content_types', 'ct'))->where($this->db->quoteName('ct.type_alias') . ' = :alias')->bind(':alias', $typeAlias);
    $this->db->setQuery($query);
    return $this->db->loadObject();
}