[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Administrator 5 * @subpackage com_menus 6 * 7 * @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org> 8 * @license GNU General Public License version 2 or later; see LICENSE.txt 9 */ 10 11 namespace Joomla\Component\Menus\Administrator\Table; 12 13 use Joomla\CMS\Language\Text; 14 use Joomla\CMS\Table\Menu; 15 use Joomla\Database\ParameterType; 16 17 // phpcs:disable PSR1.Files.SideEffects 18 \defined('_JEXEC') or die; 19 // phpcs:enable PSR1.Files.SideEffects 20 21 /** 22 * Menu table 23 * 24 * @since 1.6 25 */ 26 class MenuTable extends Menu 27 { 28 /** 29 * Method to delete a node and, optionally, its child nodes from the table. 30 * 31 * @param integer $pk The primary key of the node to delete. 32 * @param boolean $children True to delete child nodes, false to move them up a level. 33 * 34 * @return boolean True on success. 35 * 36 * @since 2.5 37 */ 38 public function delete($pk = null, $children = false) 39 { 40 $return = parent::delete($pk, $children); 41 42 if ($return) { 43 // Delete key from the #__modules_menu table 44 $db = $this->getDbo(); 45 $query = $db->getQuery(true) 46 ->delete($db->quoteName('#__modules_menu')) 47 ->where($db->quoteName('menuid') . ' = :pk') 48 ->bind(':pk', $pk, ParameterType::INTEGER); 49 $db->setQuery($query); 50 $db->execute(); 51 } 52 53 return $return; 54 } 55 56 /** 57 * Overloaded check function 58 * 59 * @return boolean True on success, false on failure 60 * 61 * @see JTable::check 62 * @since 4.0.0 63 */ 64 public function check() 65 { 66 $return = parent::check(); 67 68 if ($return) { 69 // Set publish_up to null date if not set 70 if (!$this->publish_up) { 71 $this->publish_up = null; 72 } 73 74 // Set publish_down to null date if not set 75 if (!$this->publish_down) { 76 $this->publish_down = null; 77 } 78 79 // Check the publish down date is not earlier than publish up. 80 if (!is_null($this->publish_down) && !is_null($this->publish_up) && $this->publish_down < $this->publish_up) { 81 $this->setError(Text::_('JGLOBAL_START_PUBLISH_AFTER_FINISH')); 82 83 return false; 84 } 85 86 if ((int) $this->home) { 87 // Set the publish down/up always for home. 88 $this->publish_up = null; 89 $this->publish_down = null; 90 } 91 } 92 93 return $return; 94 } 95 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |