Factory

Joomla Platform Factory class.

abstract
since

11.1

Methods

createConfig

Create a configuration object

createConfig(string $file, string $type = 'PHP', string $namespace = '') : \Joomla\Registry\Registry
static
see \Joomla\CMS\Registry
since

11.1

Arguments

$file

stringThe path to the configuration file.

$type

stringThe type of the configuration file.

$namespace

stringThe namespace of the configuration file.

Response

\Joomla\Registry\Registry

createDbo

Create a database object

createDbo() : \JDatabaseDriver
static
see \JDatabaseDriver
since

11.1

Response

\JDatabaseDriver

createDocument

Create a document object

createDocument() : \JDocument
static
see \JDocument
since

11.1

Response

\JDocumentobject

createLanguage

Create a language object

createLanguage() : \Joomla\CMS\Language\Language
static
see \Joomla\CMS\Language
since

11.1

Response

\Joomla\CMS\Language\Languageobject

createMailer

Create a mailer object

createMailer() : \JMail
static
see \JMail
since

11.1

Response

\JMailobject

createSession

Create a session object

createSession(array $options = array()) : \Joomla\CMS\Session\Session
static
since

11.1

Arguments

$options

arrayAn array containing session options

Response

\Joomla\CMS\Session\Sessionobject

getAcl

Get an authorization object

getAcl() : \Joomla\CMS\Access\Access
static deprecated

Returns the global Access object, only creating it if it doesn't already exist.

deprecated

13.3 (Platform) & 4.0 (CMS) - Use JAccess directly.

Response

\Joomla\CMS\Access\Accessobject

getApplication

Get an application object.

getApplication(mixed $id = null, array $config = array(), string $prefix = 'J') : \Joomla\CMS\Application\CMSApplication
static

Returns the global CMSApplication object, only creating it if it doesn't already exist.

see \Joomla\CMS\JApplication
since

11.1

throws

\Exception

Arguments

$id

mixedA client identifier or name.

$config

arrayAn optional associative array of configuration settings.

$prefix

stringApplication prefix

Response

\Joomla\CMS\Application\CMSApplicationobject

getCache

Get a cache object

getCache(string $group = '', string $handler = 'callback', string $storage = null) : \Joomla\CMS\Cache\CacheController
static

Returns the global \CacheController object

see \Joomla\CMS\JCache
since

11.1

Arguments

$group

stringThe cache group name

$handler

stringThe handler to use

$storage

stringThe storage method

Response

\Joomla\CMS\Cache\CacheControllerobject

getConfig

Get a configuration object

getConfig(string $file = null, string $type = 'PHP', string $namespace = '') : \Joomla\Registry\Registry
static

Returns the global \JConfig object, only creating it if it doesn't already exist.

see \Joomla\CMS\Registry
since

11.1

Arguments

$file

stringThe path to the configuration file

$type

stringThe type of the configuration file

$namespace

stringThe namespace of the configuration file

Response

\Joomla\Registry\Registry

getDate

Return the {@link Date} object

getDate(mixed $time = 'now', mixed $tzOffset = null) : \Joomla\CMS\Date\Date
static
see \Joomla\CMS\Date
since

11.1

Arguments

$time

mixedThe initial time for the JDate object

$tzOffset

mixedThe timezone offset.

Response

\Joomla\CMS\Date\Dateobject

getDbo

Get a database object.

getDbo() : \JDatabaseDriver
static

Returns the global \JDatabaseDriver object, only creating it if it doesn't already exist.

see \JDatabaseDriver
since

11.1

Response

\JDatabaseDriver

getDocument

Get a document object.

getDocument() : \JDocument
static

Returns the global \JDocument object, only creating it if it doesn't already exist.

see \JDocument
since

11.1

Response

\JDocumentobject

getEditor

Get an editor object.

getEditor(string $editor = null) : \Joomla\CMS\Editor\Editor
static deprecated
since

11.1

throws

\BadMethodCallException

deprecated

12.3 (Platform) & 4.0 (CMS) - Use Editor directly

Arguments

$editor

stringThe editor to load, depends on the editor plugins that are installed

Response

\Joomla\CMS\Editor\Editorinstance of Editor

getFeedParser

Get a parsed XML Feed Source

getFeedParser(string $url, integer $cache_time) : mixed
static deprecated
since

11.1

throws

\BadMethodCallException

deprecated

4.0 Use directly JFeedFactory or supply SimplePie instead. Mehod will be proxied to JFeedFactory beginning in 3.2

Arguments

$url

stringUrl for feed source.

$cache_time

integerTime to cache feed for (using internal cache mechanism).

Response

mixedSimplePie parsed object on success, false on failure.

getLanguage

Get a language object.

getLanguage() : \Joomla\CMS\Language\Language
static

Returns the global Language object, only creating it if it doesn't already exist.

see \Joomla\CMS\Language
since

11.1

Response

\Joomla\CMS\Language\Languageobject

getMailer

Get a mailer object.

getMailer() : \JMail
static

Returns the global \JMail object, only creating it if it doesn't already exist.

see \Joomla\CMS\JMail
since

11.1

Response

\JMailobject

getSession

Get a session object.

getSession(array $options = array()) : \Joomla\CMS\Session\Session
static

Returns the global Session object, only creating it if it doesn't already exist.

see \Joomla\CMS\Session
since

11.1

Arguments

$options

arrayAn array containing session options

Response

\Joomla\CMS\Session\Sessionobject

getStream

Creates a new stream object with appropriate prefix

getStream(boolean $use_prefix = true, boolean $use_network = true, string $ua = null, boolean $uamask = false) : \JStream
static
see \JStream
since

11.1

Arguments

$use_prefix

booleanPrefix the connections for writing

$use_network

booleanUse network if available for writing; use false to disable (e.g. FTP, SCP)

$ua

stringUA User agent to use

$uamask

booleanUser agent masking (prefix Mozilla)

Response

\JStream

getUri

Return a reference to the {@link Uri} object

getUri(string $uri = 'SERVER') : \Joomla\CMS\Uri\Uri
static deprecated
see \Joomla\CMS\Uri
since

11.1

deprecated

13.3 (Platform) & 4.0 (CMS) - Use JUri directly.

Arguments

$uri

stringUri name.

Response

\Joomla\CMS\Uri\Uriobject

getUser

Get a user object.

getUser(integer $id = null) : \Joomla\CMS\User\User
static

Returns the global User object, only creating it if it doesn't already exist.

see \Joomla\CMS\User
since

11.1

Arguments

$id

integerThe user to load - Can be an integer or string - If string, it is converted to ID automatically.

Response

\Joomla\CMS\User\Userobject

getXml

Reads a XML file.

getXml(string $data, boolean $isFile = true) : mixed
static deprecated
see \Joomla\CMS\JXMLElement
since

11.1

note

When JXMLElement is not present a SimpleXMLElement will be returned.

deprecated

13.3 (Platform) & 4.0 (CMS) - Use SimpleXML directly.

Arguments

$data

stringFull path and file name.

$isFile

booleantrue to load a file or false to load a string.

Response

mixedJXMLElement or SimpleXMLElement on success or false on error.

Properties

application

Global application object

static

cache

Global cache object

static

config

Global configuraiton object

static

Type(s)

\JConfig

dates

Container for Date instances

static

Type(s)

array

session

Global session object

static

language

Global language object

static

document

Global document object

static

Type(s)

\JDocument

acl

Global ACL object

static deprecated

database

Global database object

static

mailer

Global mailer object

static