Factory
Joomla Platform Factory class.
since |
1.7.0 |
---|
Methods
createConfig
Create a configuration object
createConfig(string $file, string $type = 'PHP', string $namespace = '') : \Joomla\Registry\Registry
see | \Joomla\Registry\Registry |
---|---|
since |
1.7.0 |
Arguments
- $file
string
The path to the configuration file.- $type
string
The type of the configuration file.- $namespace
string
The namespace of the configuration file.
Response
createDbo
Create a database object
createDbo() : \JDatabaseDriver
createDocument
Create a document object
createDocument() : \JDocument
see | \JDocument |
---|---|
since |
1.7.0 |
Response
\JDocument
object
createLanguage
Create a language object
createLanguage() : \Joomla\CMS\Language\Language
createMailer
Create a mailer object
createMailer() : \JMail
see | \JMail |
---|---|
since |
1.7.0 |
Response
\JMail
object
createSession
Create a session object
createSession(array $options = array()) : \Joomla\CMS\Session\Session
since |
1.7.0 |
---|
Arguments
- $options
array
An array containing session options
Response
getAcl
Get an authorization object
getAcl() : \Joomla\CMS\Access\Access
Returns the global Access object, only creating it if it doesn't already exist.
deprecated |
4.0 - Use JAccess directly. |
---|
Response
getApplication
Get an application object.
getApplication(mixed $id = null, array $config = array(), string $prefix = 'J') : \Joomla\CMS\Application\CMSApplication
Returns the global CMSApplication object, only creating it if it doesn't already exist.
see | \JApplication |
---|---|
since |
1.7.0 |
throws |
|
Arguments
- $id
mixed
A client identifier or name.- $config
array
An optional associative array of configuration settings.- $prefix
string
Application prefix
Response
getCache
Get a cache object
getCache(string $group = '', string $handler = 'callback', string $storage = null) : \Joomla\CMS\Cache\CacheController
Returns the global \Joomla\CMS\CacheController object
see | \Joomla\CMS\JCache |
---|---|
since |
1.7.0 |
Arguments
- $group
string
The cache group name- $handler
string
The handler to use- $storage
string
The storage method
Response
getConfig
Get a configuration object
getConfig(string $file = null, string $type = 'PHP', string $namespace = '') : \Joomla\Registry\Registry
Returns the global \JConfig object, only creating it if it doesn't already exist.
see | \Joomla\Registry\Registry |
---|---|
since |
1.7.0 |
Arguments
- $file
string
The path to the configuration file- $type
string
The type of the configuration file- $namespace
string
The namespace of the configuration file
Response
getDate
Return the {@link Date} object
getDate(mixed $time = 'now', mixed $tzOffset = null) : \Joomla\CMS\Date\Date
see | \Joomla\CMS\Date\Date |
---|---|
since |
1.7.0 |
Arguments
- $time
mixed
The initial time for the JDate object- $tzOffset
mixed
The timezone offset.
Response
\Joomla\CMS\Date\Date
object
getDbo
Get a database object.
getDbo() : \JDatabaseDriver
Returns the global \JDatabaseDriver object, only creating it if it doesn't already exist.
see | \JDatabaseDriver |
---|---|
since |
1.7.0 |
Response
getDocument
Get a document object.
getDocument() : \JDocument
Returns the global \JDocument object, only creating it if it doesn't already exist.
see | \JDocument |
---|---|
since |
1.7.0 |
Response
\JDocument
object
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
string
The editor to load, depends on the editor plugins that are installed
Response
\Joomla\CMS\Editor\Editor
instance of Editor
getFeedParser
Get a parsed XML Feed Source
getFeedParser(string $url, integer $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
string
Url for feed source.- $cacheTime
integer
Time to cache feed for (using internal cache mechanism).
Response
mixed
SimplePie parsed object on success, false on failure.
getLanguage
Get a language object.
getLanguage() : \Joomla\CMS\Language\Language
Returns the global Language object, only creating it if it doesn't already exist.
see | \Joomla\CMS\Language\Language |
---|---|
since |
1.7.0 |
Response
getMailer
Get a mailer object.
getMailer() : \JMail
Returns the global \JMail object, only creating it if it doesn't already exist.
see | \Joomla\CMS\JMail |
---|---|
since |
1.7.0 |
Response
\JMail
object
getSession
Get a session object.
getSession(array $options = array()) : \Joomla\CMS\Session\Session
Returns the global Session object, only creating it if it doesn't already exist.
see | \Joomla\CMS\Session\Session |
---|---|
since |
1.7.0 |
Arguments
- $options
array
An array containing session options
Response
getStream
Creates a new stream object with appropriate prefix
getStream(boolean $usePrefix = true, boolean $useNetwork = true, string $userAgentSuffix = null, boolean $maskUserAgent = false) : \JStream
see | \JStream |
---|---|
since |
1.7.0 |
Arguments
- $usePrefix
boolean
Prefix the connections for writing- $useNetwork
boolean
Use network if available for writing; use false to disable (e.g. FTP, SCP)- $userAgentSuffix
string
String to append to user agent- $maskUserAgent
boolean
User agent masking (prefix Mozilla)
Response
\JStream
getUri
Return a reference to the {@link Uri} object
getUri(string $uri = 'SERVER') : \Joomla\CMS\Uri\Uri
see | \Joomla\CMS\Uri\Uri |
---|---|
since |
1.7.0 |
deprecated |
4.0 - Use JUri directly. |
Arguments
- $uri
string
Uri name.
Response
\Joomla\CMS\Uri\Uri
object
getUser
Get a user object.
getUser(integer $id = null) : \Joomla\CMS\User\User
Returns the global User object, only creating it if it doesn't already exist.
see | \Joomla\CMS\User\User |
---|---|
since |
1.7.0 |
Arguments
- $id
integer
The user to load - Can be an integer or string - If string, it is converted to ID automatically.
Response
\Joomla\CMS\User\User
object
getXml
Reads a XML file.
getXml(string $data, boolean $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
string
Full path and file name.- $isFile
boolean
true to load a file or false to load a string.
Response
mixed
JXMLElement or SimpleXMLElement on success or false on error.
Properties
application
Global application object
config
Global configuraiton object
since |
1.7.0 |
---|
Type(s)
\JConfig
dates
Container for Date instances
since |
1.7.3 |
---|
Type(s)
array
document
Global document object
since |
1.7.0 |
---|
Type(s)
\JDocument
acl
Global ACL object