CoreFiles by mySites.guru
RouterServiceTrait.php60 lines, 1,317 bytes, from Joomla_4.0.0-alpha12-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha11
md5
a70187809641eed499ef9a3d70b5abe6
sha1
2f046351842f528e5e521978d250dd41537f820f
sha256
6e8bdcb81a5d5d5dd7de7d155edc7887f2cbc1e5ca8f07831461910425c4d975
<?php
/**
 * Joomla! Content Management System
 *
 * @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\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 2 releases, Joomla 4.0.0-alpha11 to 4.0.0-alpha12. See them all, or every version of this file.