- md5
- 8ad0ba2413fe52aa868688fa3a115299
- sha1
- c37f987e7e7f7cb2df307d8134198285f1f9139b
- sha256
- 1bf7e5b44fefbe72a1876a0ae4eb7d892f8d744999bc85c4190a7bfba0d8d810
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Menus\Administrator\Table;
\defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Table\Menu;
use Joomla\Database\ParameterType;
/**
* Menu table
*
* @since 1.6
*/
class MenuTable extends Menu
{
/**
* Method to delete a node and, optionally, its child nodes from the table.
*
* @param integer $pk The primary key of the node to delete.
* @param boolean $children True to delete child nodes, false to move them up a level.
*
* @return boolean True on success.
*
* @since 2.5
*/
public function delete($pk = null, $children = false)
{
$return = parent::delete($pk, $children);
if ($return)
{
// Delete key from the #__modules_menu table
$db = $this->getDbo();
$query = $db->getQuery(true)
->delete($db->quoteName('#__modules_menu'))
->where($db->quoteName('menuid') . ' = :pk')
->bind(':pk', $pk, ParameterType::INTEGER);
$db->setQuery($query);
$db->execute();
}
return $return;
}
/**
* Overloaded check function
*
* @return boolean True on success, false on failure
*
* @see JTable::check
* @since 4.0.0
*/
public function check()
{
$return = parent::check();
if ($return)
{
// Set publish_up to null date if not set
if (!$this->publish_up)
{
$this->publish_up = null;
}
// Set publish_down to null date if not set
if (!$this->publish_down)
{
$this->publish_down = null;
}
// Check the publish down date is not earlier than publish up.
if (!is_null($this->publish_down) && !is_null($this->publish_up) && $this->publish_down < $this->publish_up)
{
$this->setError(Text::_('JGLOBAL_START_PUBLISH_AFTER_FINISH'));
return false;
}
if ((int) $this->home)
{
// Set the publish down/up always for home.
$this->publish_up = null;
$this->publish_down = null;
}
}
return $return;
}
}
The same content is in 3 releases, Joomla 4.2.0-alpha3 to 4.2.0-beta2. See them all, or every version of this file.