- md5
- 5a6a7ace573ac47832aaed9fc7bf55b8
- sha1
- 1ab2aef9c924f0af294e9a0506e9ce1e8b63da79
- sha256
- b1798ea7dd7c06153724764f20b4b78ed181b757a18d5a05c967b5ba18b355ce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
<?php
/**
* @package Joomla.API
* @subpackage com_menus
*
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Menus\Api\Controller;
use Joomla\CMS\MVC\Controller\ApiController;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* The menus controller
*
* @since 4.0.0
*/
class MenusController extends ApiController
{
/**
* The content type of the item.
*
* @var string
* @since 4.0.0
*/
protected $contentType = 'menus';
/**
* The default view for the display method.
*
* @var string
* @since 3.0
*/
protected $default_view = 'menus';
/**
* Basic display of an item view
*
* @param integer $id The primary key to display. Leave empty if you want to retrieve data from the request
*
* @return static A \JControllerLegacy object to support chaining.
*
* @since 4.0.0
*/
public function displayItem($id = null)
{
$this->modelState->set('filter.client_id', $this->getClientIdFromInput());
return parent::displayItem($id);
}
/**
* Basic display of a list view
*
* @return static A \JControllerLegacy object to support chaining.
*
* @since 4.0.0
*/
public function displayList()
{
$this->modelState->set('filter.client_id', $this->getClientIdFromInput());
return parent::displayList();
}
/**
* Get client id from input
*
* @return string
*
* @since 4.0.0
*/
private function getClientIdFromInput()
{
return $this->input->exists('client_id') ?
$this->input->get('client_id') : $this->input->post->get('client_id');
}
}
The same content is in 225 releases, Joomla 4.2.1 to 6.2.1-rc1. See them all, or every version of this file.