LegacyModelLoaderTrait
Trait which contains the legacy getInstance functionality
since |
4.0.0 |
---|---|
deprecated |
5.0 Will be removed without replacement |
package |
Joomla CMS |
Methods
_createFileName
Create the filename for a resource
_createFileName(string type, array parts = array()) : string
since |
3.0 |
---|---|
deprecated |
5.0 See getInstance |
Arguments
- type
string
The resource type to create the filename for.- parts
array
An associative array of filename information.
Response
string
The filename
addTablePath
Adds to the stack of model table paths in LIFO order.
addTablePath(mixed path) : void
since |
3.0 |
---|---|
deprecated |
5.0 See getInstance |
Arguments
- path
mixed
The directory as a string or directories as an array to add.
createModelFromComponent
Returns a Model object by loading the component from the prefix.
createModelFromComponent(string type, string prefix = '', array config = []) : \Joomla\CMS\MVC\Model\ModelInterface|null
since |
4.0.0 |
---|---|
deprecated |
5.0 See getInstance |
Arguments
- type
string
The model type to instantiate- prefix
string
Prefix for the model class name. Optional.- config
array
Configuration array for model. Optional.
Response
\Joomla\CMS\MVC\Model\ModelInterface|null
A ModelInterface instance or null on failure
getInstance
Returns a Model object, always creating it
getInstance(string type, string prefix = '', array config = array()) : self|bool
since |
3.0 |
---|---|
deprecated |
5.0 Get the model through the MVCFactory instead |
Arguments
- type
string
The model type to instantiate- prefix
string
Prefix for the model class name. Optional.- config
array
Configuration array for model. Optional.
Response
self|bool
A \JModelLegacy instance or false on failure