Actions

API16

JTableCategory/check

From Joomla! Documentation

< API16:JTableCategory
Revision as of 16:42, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Override check function

[Edit Descripton]

Description:JTableCategory/check

Syntax

check()


Returns

boolean

Defined in

libraries/joomla/database/table/category.php

Importing

jimport( 'joomla.database.table.category' );

Source Body

public function check()
{
        // Check for a title.
        if (trim($this->title) == '') {
                $this->setError(JText::sprintf('MUST_CONTAIN_A_TITLE', JText::_('Category')));
                return false;
        }
 
        if (empty($this->alias)) {
                $this->alias = strtolower($this->title);
        }
 
        $this->alias = JApplication::stringURLSafe($this->alias);
        if (trim(str_replace('-','',$this->alias)) == '') {
                $this->alias = JFactory::getDate()->toFormat('%Y-%m-%d-%H-%M-%S');
        }
 
        return true;
}

[Edit See Also] SeeAlso:JTableCategory/check

Examples

<CodeExamplesForm />