CoreFiles by mySites.guru
RouterServiceTrait.php60 lines, 1,317 bytes, from Joomla_4.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta4
md5
8f73f5858deb2634db6ec47f5eb7ad6e
sha1
965c12ebdb9f99d7f936d994e89e0addf814241a
sha256
116f3f05e347f2253f9bf4a20e283b3cdd63d8557261d0aeebaa2d59eaf6586f
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Component\Router;

\defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Menu\AbstractMenu;

/**
 * Trait to implement AssociationServiceInterface
 *
 * @since  4.0.0
 */
trait RouterServiceTrait
{
	/**
	 * The router factory.
	 *
	 * @var RouterFactoryInterface
	 *
	 * @since  4.0.0
	 */
	private $routerFactory = null;

	/**
	 * Returns the router.
	 *
	 * @param   CMSApplicationInterface  $application  The application object
	 * @param   AbstractMenu             $menu         The menu object to work with
	 *
	 * @return  RouterInterface
	 *
	 * @since  4.0.0
	 */
	public function createRouter(CMSApplicationInterface $application, AbstractMenu $menu): RouterInterface
	{
		return $this->routerFactory->createRouter($application, $menu);
	}

	/**
	 * The router factory.
	 *
	 * @param   RouterFactoryInterface  $routerFactory  The router factory
	 *
	 * @return  void
	 *
	 * @since  4.0.0
	 */
	public function setRouterFactory(RouterFactoryInterface $routerFactory)
	{
		$this->routerFactory = $routerFactory;
	}
}

The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.