Actions

API16

JTableNested/setLocation

From Joomla! Documentation

< API16:JTableNested
Revision as of 17:43, 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

Method to set the location of a node in the tree object. This method does not save the new location to the database, but will set it in the object so that when the node is stored it will be stored in the new location.

[Edit Descripton]

Description:JTableNested/setLocation

Syntax

setLocation($referenceId, $position= 'after')
Parameter Name Default Value Description
$referenceId The primary key of the node to reference new location by.
$position 'after' Location type string. ['before', 'after', 'first-child', 'last-child']

Returns

boolean True on success.

Defined in

libraries/joomla/database/tablenested.php

Importing

jimport( 'joomla.database.tablenested' );

Source Body

public function setLocation($referenceId, $position = 'after')
{
        // Make sure the location is valid.
        if (($position != 'before') && ($position != 'after') &&
                ($position != 'first-child') && ($position != 'last-child')) {
                return false;
        }
 
        // Set the location properties.
        $this->_location = $position;
        $this->_location_id = $referenceId;
 
        return true;
}

[Edit See Also] SeeAlso:JTableNested/setLocation

Examples

<CodeExamplesForm />