Documentation Menu

1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 9 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow Manual arrow 11. API Reference arrow [WORKING] mosDBTable->publish_array

[WORKING] mosDBTable->publish_array PDF Print E-mail

Last reviewed: Not reviewed
phpDocumentor

mosDBTable->publish_array

Generic publish/unpublish function.  Returns true if successful; false otherwise.  If returning false then an error message can be retrieved using the mosDBTable->getError function.

Note: In Joomla! 1.0.4 this method does not return a boolean and so it is not possible to determine if the method succeeded or not.

Syntax

boolean publish_array ( array $id [, int $publish [, int $myid ]] )

$id
is an array of primary keys for records to be published or unpublished.  If the array is empty then publish_array will return false.
$publish
is 0 to unpublish or 1 to publish.  This parameter is optional and if omitted will default to 1 (publish).
$myid
is the id of the user performing the operation.  This parameter is optional and if omitted will default to 0.

Examples

Example: In this example menu records with particular item id's are unpublished.

global $database, $my;
 
// Declare an instance of the menu class.
$menu = new mosMenu( $database );
 
// Create an array of record id's to be unpublished.
$idarray = array( 2, 3, 5 );
 
// Unpublish the menu records with these id's.
$menu->publish_array( $idarray, 0, $my->id );

Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Monday, 25 December 2006 )
 
< Prev   Next >