Back to Update class

Method check

public bool
check
()
Overloaded check function
Returns
  • bool True if the object is ok
Since
  • 1.7.0
-
  • \Joomla\CMS\Table\Table::check()
Class: Update
Project: Joomla

Method check - Source code

/**
 * Overloaded check function
 *
 * @return  boolean  True if the object is ok
 *
 * @see     Table::check()
 * @since   1.7.0
 */
public function check()
{
    try {
        parent::check();
    } catch (\Exception $e) {
        $this->setError($e->getMessage());
        return false;
    }
    // Check for valid name
    if (trim($this->name) == '' || trim($this->element) == '') {
        $this->setError(Text::_('JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_EXTENSION'));
        return false;
    }
    if (!$this->update_id && !$this->data) {
        $this->data = '';
    }
    // While column is not nullable, make sure we have a value.
    if ($this->description === null) {
        $this->description = '';
    }
    return true;
}