- md5
- 9cc948e51c23a72fc7d69206e688c274
- sha1
- fc2c1b1cf7201980ccd3ea66736f0a42b7907581
- sha256
- 3cb0ad15b8f3f14d976bdef25d11f090d40eb58c7969f531a893851f3c79d9aa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
<?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
*/
namespace Joomla\CMS\MVC\Factory;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Form\FormFactoryAwareInterface;
use Joomla\CMS\Form\FormFactoryAwareTrait;
/**
* Factory to create MVC factories.
*
* @since 4.0.0
*/
class MVCFactoryFactory implements MVCFactoryFactoryInterface, FormFactoryAwareInterface
{
use FormFactoryAwareTrait;
/**
* The namespace.
*
* @var string
* @since 4.0.0
*/
private $namespace;
/**
* The constructor.
*
* @param string $namespace The extension namespace
*
* @since 4.0.0
*/
public function __construct(string $namespace)
{
$this->namespace = $namespace;
}
/**
* Method to create a factory object.
*
* @param CMSApplicationInterface $application The application.
*
* @return \Joomla\CMS\MVC\Factory\MVCFactoryInterface
*
* @since 4.0.0
* @throws \Exception
*/
public function createFactory(CMSApplicationInterface $application): MVCFactoryInterface
{
if (!$this->namespace)
{
return new LegacyFactory;
}
$factory = new MVCFactory($this->namespace, $application);
try
{
$factory->setFormFactory($this->getFormFactory());
}
catch (\UnexpectedValueException $e)
{
}
return $factory;
}
}
No other release has this exact content. See every version of this file.