CoreFiles by mySites.guru
MVCFactoryAwareTrait.php57 lines, 1,047 bytes, from Joomla_4.0.0-alpha12-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha11
md5
c294600317dbce72c90638f2f7adbcd3
sha1
80f22dc4048d60371bb5893676742e7bfa930664
sha256
94dbde81a556a975f73ce0826a92b8ebce2f3353c810bfef2fae40bedae20487
<?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\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;
	}
}

The same content is in 6 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha12. See them all, or every version of this file.