CoreFiles by mySites.guru
MVCFactoryServiceTrait.php58 lines, 1,108 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
4f63a466cbf9cadd233f9f5e89de303d
sha1
831595be9b565e6037b14190382d54457db35fad
sha256
7151e45f0e7f61a2af85412705c8c8bc36f7e16af4f33db90f588ee453e63179
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\MVC\Factory;

defined('_JEXEC') or die;

/**
 * Defines the trait for a MVC factory service class.
 *
 * @since  4.0.0
 */
trait MVCFactoryServiceTrait
{
	/**
	 * The MVC Factory.
	 *
	 * @var MVCFactoryInterface
	 */
	private $mvcFactory;

	/**
	 * Get the factory.
	 *
	 * @return  MVCFactoryInterface
	 *
	 * @since   4.0.0
	 * @throws  \UnexpectedValueException May be thrown if the factory has not been set.
	 */
	public function getMVCFactory(): MVCFactoryInterface
	{
		if (!$this->mvcFactory)
		{
			throw new \UnexpectedValueException('MVC factory not set in ' . __CLASS__);
		}

		return $this->mvcFactory;
	}

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

The same content is in 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.