[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * Joomla! Content Management System 5 * 6 * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> 7 * @license GNU General Public License version 2 or later; see LICENSE.txt 8 */ 9 10 namespace Joomla\CMS\MVC\Factory; 11 12 // phpcs:disable PSR1.Files.SideEffects 13 \defined('_JEXEC') or die; 14 // phpcs:enable PSR1.Files.SideEffects 15 16 /** 17 * MVCFactory aware trait. 18 * 19 * @since 4.0.0 20 */ 21 trait MVCFactoryAwareTrait 22 { 23 /** 24 * The mvc factory. 25 * 26 * @var MVCFactoryInterface 27 * @since 4.0.0 28 */ 29 private $mvcFactory; 30 31 /** 32 * Returns the MVC factory. 33 * 34 * @return MVCFactoryInterface 35 * 36 * @since 4.0.0 37 * @throws \UnexpectedValueException 38 */ 39 protected function getMVCFactory(): MVCFactoryInterface 40 { 41 if ($this->mvcFactory) { 42 return $this->mvcFactory; 43 } 44 45 throw new \UnexpectedValueException('MVC Factory not set in ' . __CLASS__); 46 } 47 48 /** 49 * Set the MVC factory. 50 * 51 * @param MVCFactoryInterface $mvcFactory The MVC factory 52 * 53 * @return void 54 * 55 * @since 4.0.0 56 */ 57 public function setMVCFactory(MVCFactoryInterface $mvcFactory) 58 { 59 $this->mvcFactory = $mvcFactory; 60 } 61 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |