MVCFactory

Implements MVCFactoryInterface, FormFactoryAwareInterface, SiteRouterAwareInterface, UserFactoryAwareInterface, MailerFactoryAwareInterface

Factory to create MVC objects based on a namespace.

since

3.10.0

package

Joomla CMS

Methods

__construct

The namespace must be like: Joomla\Component\Content

__construct( namespace) : 
since

4.0.0

Arguments

namespace

stringThe namespace

Response

mixed

createController

Method to load and return a controller object.

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

3.10.0

throws

Exception

Arguments

name

stringThe name of the controller

prefix

stringThe controller prefix

config

array<string|int, mixed>The configuration array for the controller

app

CMSApplicationInterfaceThe app

input

InputThe input

Response

ControllerInterface

createModel

Method to load and return a model object.

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

3.10.0

throws

Exception

Arguments

name

stringThe name of the model.

prefix

stringOptional model prefix.

config

array<string|int, mixed>Optional configuration array for the model.

Response

ModelInterfaceThe model object

createTable

Method to load and return a table object.

createTable( name,  prefix = '', mixed||string|int config = []) : \Joomla\CMS\Table\Table
since

3.10.0

throws

Exception

Arguments

name

stringThe name of the table.

prefix

stringOptional table prefix.

config

array<string|int, mixed>Optional configuration array for the table.

Response

TableThe table object

createView

Method to load and return a view object.

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

3.10.0

throws

Exception

Arguments

name

stringThe name of the view.

prefix

stringOptional view prefix.

type

stringOptional type of view.

config

array<string|int, mixed>Optional configuration array for the view.

Response

ViewInterfaceThe view object

getCacheControllerFactory

Get the CacheControllerFactoryInterface.

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

4.2.0

Response

CacheControllerFactoryInterface

getClassName

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

getClassName( suffix,  prefix) : string|null
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

FormFactoryInterface

getMailerFactory

Get the MailerFactoryInterface.

getMailerFactory() : \Joomla\CMS\Mail\MailerFactoryInterface
inherited
since

4.4.0

throws

UnexpectedValueExceptionMay be thrown if the MailerFactory has not been set.

Response

MailerFactoryInterface

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

SiteRouter

getUserFactory

Get the UserFactoryInterface.

getUserFactory() : \Joomla\CMS\User\UserFactoryInterface
inherited
since

4.4.0

throws

UnexpectedValueExceptionMay be thrown if the UserFactory has not been set.

Response

UserFactoryInterface

setCacheControllerFactory

Set the cache controller factory to use.

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

4.2.0

Arguments

cacheControllerFactory

CacheControllerFactoryInterfaceThe cache controller factory to use.

Response

void

setCacheControllerOnObject

Sets the internal cache controller on the given object.

setCacheControllerOnObject( object) : 
since

4.2.0

Arguments

object

objectThe object

Response

void

setDispatcherOnObject

Sets the internal event dispatcher on the given object.

setDispatcherOnObject( object) : 
since

4.2.0

Arguments

object

objectThe object

Response

void

setFormFactory

Set the form factory to use.

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

4.0.0

Arguments

formFactory

FormFactoryInterface|nullThe form factory to use.

Response

$this

setFormFactoryOnObject

Sets the internal form factory on the given object.

setFormFactoryOnObject( object) : 
since

4.0.0

Arguments

object

objectThe object

Response

void

setMailerFactory

Set the mailer factory to use.

setMailerFactory(\Joomla\CMS\Mail\MailerFactoryInterface mailerFactory = null) : 
inherited
since

4.4.0

Arguments

mailerFactory

MailerFactoryInterface|nullThe mailer factory to use.

Response

void

setMailerFactoryOnObject

Sets the internal mailer factory on the given object.

setMailerFactoryOnObject( object) : 
since

4.4.0

Arguments

object

objectThe object

Response

void

setRouterOnObject

Sets the internal router on the given object.

setRouterOnObject( object) : 
since

4.2.0

Arguments

object

objectThe object

Response

void

setSiteRouter

Set the router to use.

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

4.2.0

Arguments

router

SiteRouterThe router to use.

Response

void

setUserFactory

Set the user factory to use.

setUserFactory(\Joomla\CMS\User\UserFactoryInterface userFactory) : 
inherited
since

4.4.0

Arguments

userFactory

UserFactoryInterfaceThe user factory to use.

Response

void

setUserFactoryOnObject

Sets the internal user factory on the given object.

setUserFactoryOnObject( object) : 
since

4.4.0

Arguments

object

objectThe object

Response

void

Properties

mailerFactory

MailerFactoryInterface

inherited
since

4.4.0

Type(s)

MailerFactoryInterface

userFactory

UserFactoryInterface

inherited
since

4.4.0

Type(s)

UserFactoryInterface

cacheControllerFactory

CacheControllerFactoryInterface

inherited
since

4.2.0

Type(s)

CacheControllerFactoryInterface

router

inherited
since

4.2.0

Type(s)

SiteRouter

formFactory

FormFactoryInterface

inherited
since

4.0.0

Type(s)

FormFactoryInterface

namespace

The namespace to create the objects from.

since

4.0.0

Type(s)

string