- md5
- 19a7593ce1cda8d0bb7479afa7ca8517
- sha1
- 34e152a36320ab595270020069fb35e307e6da78
- sha256
- a4a632851f44d38aa39bb729f6ee6f75a887e055d92ec0192593c6552ff86a50
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @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\Factory;
use Joomla\CMS\Language\Text;
/**
* Menu table
*
* @since 1.6
*/
class MenuTable extends \JTableMenu
{
/**
* 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 = Factory::getDbo();
$query = $db->getQuery(true)
->delete($db->quoteName('#__modules_menu'))
->where($db->quoteName('menuid') . ' = ' . $pk);
$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;
}
}
No other release has this exact content. See every version of this file.