Back to UCMType class

Method getType

public object
getType
(mixed $pk = null)
Get the Content Type
Parameters
  • int $pk The primary key of the alias type
Returns
  • object The UCM Type data
Since
  • 3.1
Class: UCMType
Project: Joomla

Method getType - Source code

/**
 * Get the Content Type
 *
 * @param   integer  $pk  The primary key of the alias type
 *
 * @return  object  The UCM Type data
 *
 * @since   3.1
 */
public function getType($pk = null)
{
    if (!$pk) {
        return $this->getTypeByAlias($this->alias);
    }
    $query = $this->db->getQuery(true)->select($this->db->quoteName('ct') . '.*')->from($this->db->quoteName('#__content_types', 'ct'))->where($this->db->quoteName('ct.type_id') . ' = :pk')->bind(':pk', $pk, ParameterType::INTEGER);
    $this->db->setQuery($query);
    return $this->db->loadObject();
}