Back to MVCFactoryServiceTrait class

Method getMVCFactory

public \Joomla\CMS\MVC\Factory\MVCFactoryInterface
getMVCFactory
()
Get the factory.
Returns
  • \Joomla\CMS\MVC\Factory\MVCFactoryInterface
Since
  • 4.0.0
-
  • \UnexpectedValueException May be thrown if the factory has not been set.

Method getMVCFactory - Source code

/**
 * 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;
}