CoreFiles by mySites.guru
MVCFactoryAwareTrait.php57 lines, 1,034 bytes, from Joomla_4.0.0-beta6-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta5
md5
553fcc65d1d205024dbe534abe754c7b
sha1
e2df0c601ceeb279ead8d9e7c9891f4cf9afa149
sha256
84fafcc72b8e900f8ce1282c2c77ec324473e08b339e1c39449a7d940abbf217
<?php
/**
 * Joomla! Content Management System
 *
 * @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\CMS\MVC\Factory;

/**
 * MVCFactory aware trait.
 *
 * @since  4.0.0
 */
trait MVCFactoryAwareTrait
{
	/**
	 * The mvc factory.
	 *
	 * @var    MVCFactoryInterfaceCF
	 * @since  4.0.0
	 */
	private $mvcFactory;

	/**
	 * Returns the MVC factory.
	 *
	 * @return  MVCFactoryInterface
	 *
	 * @since   4.0.0
	 * @throws  \UnexpectedValueException
	 */
	protected function getMVCFactory(): MVCFactoryInterface
	{
		if ($this->mvcFactory)
		{
			return $this->mvcFactory;
		}

		throw new \UnexpectedValueException('MVC Factory not set in ' . __CLASS__);
	}

	/**
	 * Set the MVC factory.
	 *
	 * @param   MVCFactoryInterface  $mvcFactory  The MVC factory
	 *
	 * @return  void
	 *
	 * @since   4.0.0
	 */
	public function setMVCFactory(MVCFactoryInterface $mvcFactory)
	{
		$this->mvcFactory = $mvcFactory;
	}
}

No other release has this exact content. See every version of this file.