API15

Difference between revisions of "JTable/check"

From Joomla! Documentation

< API15:JTable
Line 44: Line 44:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
<code>
+
<source lang="php">function check() {
function check() {
+
    if($this->title == ''){
+
        $this->setError(JText::_('This record requires a title'));  
if($this->title == ''){
+
        return false;
$this->setError(JText::_('This record requires a title'));  
+
    }
return false;
+
    return true;
}
+
}</source>
return true;
 
}
 
 
 
</code>
 

Revision as of 11:13, 1 August 2010

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Generic check method

[Edit Descripton]

Template:Description:JTable/check

Syntax[edit]

check()


Returns[edit]

boolean True if the object is ok

Defined in[edit]

libraries/joomla/database/table.php

Importing[edit]

jimport( 'joomla.database.table' );

Source Body[edit]

function check()
{
        return true;
}

[Edit See Also] Template:SeeAlso:JTable/check

Examples[edit]

<CodeExamplesForm />


function check() {
    if($this->title == ''){
        $this->setError(JText::_('This record requires a title')); 
        return false;
    }
    return true;
}