Back to ContentType class

Method check

public bool
check
()
Overloaded check method to ensure data integrity.
Returns
  • bool True on success.
Since
  • 3.1
-
  • \UnexpectedValueException
Class: ContentType
Project: Joomla

Method check - Source code

/**
 * Overloaded check method to ensure data integrity.
 *
 * @return  boolean  True on success.
 *
 * @since   3.1
 * @throws  \UnexpectedValueException
 */
public function check()
{
    try {
        parent::check();
    } catch (\Exception $e) {
        $this->setError($e->getMessage());
        return false;
    }
    // Check for valid name.
    if (trim($this->type_title) === '') {
        throw new \UnexpectedValueException(sprintf('The title is empty'));
    }
    $this->type_title = ucfirst($this->type_title);
    if (empty($this->type_alias)) {
        throw new \UnexpectedValueException(sprintf('The type_alias is empty'));
    }
    return true;
}