Actions

API15

Difference between revisions of "JTable/check"

From Joomla! Documentation

< API15:JTable
(Examples)
(Examples)
(One intermediate revision by one user not shown)
Line 34: Line 34:
  
 
===Examples===
 
===Examples===
 +
<source lang="php">function check() {
 +
    if($this->title == ''){
 +
        $this->setError(JText::_('This record requires a title'));
 +
        return false;
 +
    }
 +
    return true;
 +
}</source>
 
<CodeExamplesForm />
 
<CodeExamplesForm />
 
<dpl>
 
<dpl>
Line 44: Line 51:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
<code>
 
function check() {
 
 
if($this->title == ''){
 
$this->setError(JText::_('This record requires a title'));
 
return false;
 
}
 
return true;
 
}
 
 
</code>
 

Revision as of 11:13, 1 August 2010

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

Generic check method

[Edit Descripton]

Description:JTable/check

Syntax

check()


Returns

boolean True if the object is ok

Defined in

libraries/joomla/database/table.php

Importing

jimport( 'joomla.database.table' );

Source Body

function check()
{
        return true;
}

[Edit See Also] SeeAlso:JTable/check

Examples

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

<CodeExamplesForm />