Factory

Joomla Platform Factory class.

abstract
since

1.7.0

package

Joomla CMS

Methods

createConfig

Create a configuration object

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

1.7.0

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

1.7.0

Response

\JDatabaseDriver

createDocument

Create a document object

createDocument() : \JDocument
static
see JDocument
since

1.7.0

Response

\JDocumentobject

createLanguage

Create a language object

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

1.7.0

Response

\Joomla\CMS\Language\Languageobject

createMailer

Create a mailer object

createMailer() : \JMail
static
see JMail
since

1.7.0

Response

\JMailobject

createSession

Create a session object

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

1.7.0

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 {@link Access} object, only creating it if it doesn't already exist.

deprecated

4.0 - 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 {@link CMSApplication} object, only creating it if it doesn't already exist.

see JApplication
since

1.7.0

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 {@link CacheController} object

see JCache
since

1.7.0

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 {@link \JConfig} object, only creating it if it doesn't already exist.

see Registry
since

1.7.0

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 Date
since

1.7.0

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 {@link \JDatabaseDriver} object, only creating it if it doesn't already exist.

see JDatabaseDriver
since

1.7.0

Response

\JDatabaseDriver

getDocument

Get a document object.

getDocument() : \JDocument
static

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

see JDocument
since

1.7.0

Response

\JDocumentobject

getEditor

Get an editor object.

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

1.7.0

throws

\BadMethodCallException

deprecated

4.0 - 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, int cacheTime) : mixed
static deprecated
since

1.7.0

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.

cacheTime

intTime 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 {@link Language} object, only creating it if it doesn't already exist.

see Language
since

1.7.0

Response

\Joomla\CMS\Language\Languageobject

getMailer

Get a mailer object.

getMailer() : \JMail
static

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

see JMail
since

1.7.0

Response

\JMailobject

getSession

Get a session object.

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

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

see Session
since

1.7.0

Arguments

options

arrayAn array containing session options

Response

\Joomla\CMS\Session\Sessionobject

getStream

Creates a new stream object with appropriate prefix

getStream(bool usePrefix = true, bool useNetwork = true, string userAgentSuffix = null, bool maskUserAgent = false) : \JStream
static
see JStream
since

1.7.0

Arguments

usePrefix

boolPrefix the connections for writing

useNetwork

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

userAgentSuffix

stringString to append to user agent

maskUserAgent

boolUser 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 Uri
since

1.7.0

deprecated

4.0 - Use JUri directly.

Arguments

uri

stringUri name.

Response

\Joomla\CMS\Uri\Uriobject

getUser

Get a user object.

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

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

see User
since

1.7.0

Arguments

id

intThe 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, bool isFile = true) : mixed
static deprecated
see JXMLElement
since

1.7.0

note

When JXMLElement is not present a SimpleXMLElement will be returned.

deprecated

4.0 - Use SimpleXML directly.

Arguments

data

stringFull path and file name.

isFile

booltrue 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
since

1.7.0

Type(s)

\Joomla\CMS\Application\CMSApplication

cache

Global cache object

static
since

1.7.0

Type(s)

\Joomla\CMS\Cache\Cache

config

Global configuraiton object

static
since

1.7.0

Type(s)

\JConfig

dates

Container for Date instances

static
since

1.7.3

Type(s)

array

session

Global session object

static
since

1.7.0

Type(s)

\Joomla\CMS\Session\Session

language

Global language object

static
since

1.7.0

Type(s)

\Joomla\CMS\Language\Language

document

Global document object

static
since

1.7.0

Type(s)

\JDocument

acl

Global ACL object

static deprecated
since

1.7.0

deprecated

4.0

Type(s)

\Joomla\CMS\Access\Access

database

Global database object

static
since

1.7.0

Type(s)

\JDatabaseDriver

mailer

Global mailer object

static
since

1.7.0

Type(s)

\Joomla\CMS\Mail\Mail