API15

JTableSection/check: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Overloaded check function <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> ...
 
m removing red link to edit, no existant pages
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JTableSection/check|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JTableSection/check}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 58: Line 58:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JTableSection/check|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JTableSection/check}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
Line 73: Line 73:
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API15]]

Revision as of 18:53, 12 May 2013

Description

Overloaded check function

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

check()


Returns

boolean

Defined in

libraries/joomla/database/table/section.php

Importing

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

Source Body

function check()
{
        // check for valid name
        if (trim( $this->title ) == '') {
                $this->setError( JText::_( 'SECTION MUST HAVE A TITLE') );
                return false;
        }

        // check for existing name
        /*$query = "SELECT id"
        . ' FROM #__sections "
        . ' WHERE title = '. $this->_db->Quote($this->title)
        . ' AND scope = ' . $this->_db->Quote($this->scope)
        ;
        $this->_db->setQuery( $query );

        $xid = intval( $this->_db->loadResult() );
        if ($xid && $xid != intval( $this->id )) {
                $this->_error = JText::sprintf( 'WARNNAMETRYAGAIN', JText::_( 'Section') );
                return false;
        }*/

        if(empty($this->alias)) {
                $this->alias = $this->title;
        }
        $this->alias = JFilterOutput::stringURLSafe($this->alias);
        if(trim(str_replace('-','',$this->alias)) == '') {
                $datenow =& JFactory::getDate();
                $this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S");
        }

        return true;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />