Factory
Joomla Platform Factory class.
| since |
1.7.0 |
|---|---|
| package |
Joomla CMS |
Methods
createConfig
Create a configuration object
createConfig(string file, string type = 'PHP', string namespace = '') : \Joomla\Registry\Registry
| 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
| see | JDatabaseDriver |
|---|---|
| since |
1.7.0 |
Response
\JDatabaseDriver
createDocument
Create a document object
createDocument() : \JDocument
| see | JDocument |
|---|---|
| since |
1.7.0 |
Response
\JDocumentobject
createLanguage
Create a language object
createLanguage() : \Joomla\CMS\Language\Language
createMailer
Create a mailer object
createMailer() : \JMail
| see | JMail |
|---|---|
| since |
1.7.0 |
Response
\JMailobject
createSession
Create a session object
createSession(array options = array()) : \Joomla\CMS\Session\Session
| 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
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
Returns the global {@link CMSApplication} object, only creating it if it doesn't already exist.
| see | JApplication |
|---|---|
| since |
1.7.0 |
| throws |
|
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
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
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
| 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
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
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
| since |
1.7.0 |
|---|---|
| throws |
|
| 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
| since |
1.7.0 |
|---|---|
| throws |
|
| 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
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
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
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
| 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
| 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
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
| 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
| since |
1.7.0 |
|---|
Type(s)
\Joomla\CMS\Application\CMSApplication
cache
Global cache object
| since |
1.7.0 |
|---|
Type(s)
\Joomla\CMS\Cache\Cache
config
Global configuraiton object
| since |
1.7.0 |
|---|
Type(s)
\JConfig
dates
Container for Date instances
| since |
1.7.3 |
|---|
Type(s)
array
session
Global session object
| since |
1.7.0 |
|---|
Type(s)
\Joomla\CMS\Session\Session
language
Global language object
| since |
1.7.0 |
|---|
Type(s)
\Joomla\CMS\Language\Language
document
Global document object
| since |
1.7.0 |
|---|
Type(s)
\JDocument
acl
Global ACL object
| since |
1.7.0 |
|---|---|
| deprecated |
4.0 |
Type(s)
\Joomla\CMS\Access\Access
database
Global database object
| since |
1.7.0 |
|---|
Type(s)
\JDatabaseDriver
mailer
Global mailer object
| since |
1.7.0 |
|---|
Type(s)
\Joomla\CMS\Mail\Mail