ApiMVCFactory

Extends MVCFactory

Factory to create MVC objects based on a namespace. Note that in an API Application model and table objects will be created from their administrator counterparts.

final
since

4.0.0

package

Joomla CMS

Methods

__construct

The namespace must be like: Joomla\Component\Content

__construct(string namespace) : mixed
inherited
since

4.0.0

Arguments

namespace

stringThe namespace

Response

mixed

createController

Method to load and return a controller object.

createController(string name, string prefix, array config, \Joomla\CMS\Application\CMSApplicationInterface app, \Joomla\Input\Input input) : \Joomla\CMS\MVC\Controller\ControllerInterface
inherited
since

3.10.0

throws

\Exception

Arguments

name

stringThe name of the controller

prefix

stringThe controller prefix

config

arrayThe configuration array for the controller

app

\Joomla\CMS\Application\CMSApplicationInterfaceThe app

input

\Joomla\Input\InputThe input

Response

\Joomla\CMS\MVC\Controller\ControllerInterface

createModel

Method to load and return a model object.

createModel(string name, string prefix = '', array config = []) : \Joomla\CMS\MVC\Model\ModelInterface
inherited
since

3.10.0

throws

\Exception

Arguments

name

stringThe name of the model.

prefix

stringOptional model prefix.

config

arrayOptional configuration array for the model.

Response

\Joomla\CMS\MVC\Model\ModelInterfaceThe model object

createTable

Method to load and return a table object.

createTable(string name, string prefix = '', array config = []) : \Joomla\CMS\Table\Table
inherited
since

3.10.0

throws

\Exception

Arguments

name

stringThe name of the table.

prefix

stringOptional table prefix.

config

arrayOptional configuration array for the table.

Response

\Joomla\CMS\Table\TableThe table object

createView

Method to load and return a view object.

createView(string name, string prefix = '', string type = '', array config = []) : \Joomla\CMS\MVC\View\ViewInterface
inherited
since

3.10.0

throws

\Exception

Arguments

name

stringThe name of the view.

prefix

stringOptional view prefix.

type

stringOptional type of view.

config

arrayOptional configuration array for the view.

Response

\Joomla\CMS\MVC\View\ViewInterfaceThe view object

getCacheControllerFactory

Get the CacheControllerFactoryInterface.

getCacheControllerFactory() : \Joomla\CMS\Cache\CacheControllerFactoryInterface
inherited
since

4.2.0

Response

\Joomla\CMS\Cache\CacheControllerFactoryInterface

getClassName

Returns a standard classname, if the class doesn't exist null is returned.

getClassName(string suffix, string prefix) : string|null
inherited
since

3.10.0

Arguments

suffix

stringThe suffix

prefix

stringThe prefix

Response

string|nullThe class name

getFormFactory

Get the FormFactoryInterface.

getFormFactory() : \Joomla\CMS\Form\FormFactoryInterface
inherited
since

4.0.0

throws

\UnexpectedValueExceptionMay be thrown if the FormFactory has not been set.

Response

\Joomla\CMS\Form\FormFactoryInterface

getSiteRouter

Get the site router.

getSiteRouter() : \Joomla\CMS\Router\SiteRouter
inherited
since

4.2.0

throws

\UnexpectedValueExceptionMay be thrown if the router has not been set.

Response

\Joomla\CMS\Router\SiteRouter

setCacheControllerFactory

Set the cache controller factory to use.

setCacheControllerFactory(\Joomla\CMS\Cache\CacheControllerFactoryInterface cacheControllerFactory = null) : void
inherited
since

4.2.0

Arguments

cacheControllerFactory

\Joomla\CMS\Cache\CacheControllerFactoryInterfaceThe cache controller factory to use.

setCacheControllerOnObject

Sets the internal cache controller on the given object.

setCacheControllerOnObject(object object) : void
inherited
since

4.2.0

Arguments

object

objectThe object

setDispatcherOnObject

Sets the internal event dispatcher on the given object.

setDispatcherOnObject(object object) : void
inherited
since

4.2.0

Arguments

object

objectThe object

setFormFactory

Set the form factory to use.

setFormFactory(\Joomla\CMS\Form\FormFactoryInterface formFactory = null) : $this
inherited
since

4.0.0

Arguments

formFactory

\Joomla\CMS\Form\FormFactoryInterfaceThe form factory to use.

Response

$this

setFormFactoryOnObject

Sets the internal form factory on the given object.

setFormFactoryOnObject(object object) : void
inherited
since

4.0.0

Arguments

object

objectThe object

setRouterOnObject

Sets the internal router on the given object.

setRouterOnObject(object object) : void
inherited
since

4.2.0

Arguments

object

objectThe object

setSiteRouter

Set the router to use.

setSiteRouter(\Joomla\CMS\Router\SiteRouter router) : void
inherited
since

4.2.0

Arguments

router

\Joomla\CMS\Router\SiteRouterThe router to use.

Properties

namespace

The namespace to create the objects from.

inherited
since

4.0.0

Type(s)

string

formFactory

FormFactoryInterface

inherited
since

4.0.0

Type(s)

FormFactoryInterface

router

inherited
since

4.2.0

Type(s)

SiteRouter

cacheControllerFactory

CacheControllerFactoryInterface

inherited
since

4.2.0

Type(s)

CacheControllerFactoryInterface