- md5
- 0d95fad652aacd7dd24742b113a2a591
- sha1
- b31634faa335835aa40925a0b639a0bd22d72266
- sha256
- b8b608b7cb7f77288ad5f764699378559b65f89b78c20916c174d457e8a5f323
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
<?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;
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 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.