LegacyModelLoaderTrait

Trait which contains the legacy getInstance functionality

deprecated
since

4.0.0

deprecated

5.0 Will be removed without replacement

package

Application

Methods

_createFileName

Create the filename for a resource

_createFileName(string type, array parts = array()) : string
static deprecated
since

3.0

deprecated

5.0 See getInstance

Arguments

type

stringThe resource type to create the filename for.

parts

arrayAn associative array of filename information.

Response

stringThe filename

addTablePath

Adds to the stack of model table paths in LIFO order.

addTablePath(mixed path) : void
static deprecated
since

3.0

deprecated

5.0 See getInstance

Arguments

path

mixedThe 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
static deprecated
since

4.0.0

deprecated

5.0 See getInstance

Arguments

type

stringThe model type to instantiate

prefix

stringPrefix for the model class name. Optional.

config

arrayConfiguration array for model. Optional.

Response

\Joomla\CMS\MVC\Model\ModelInterface|nullA ModelInterface instance or null on failure

getInstance

Returns a Model object, always creating it

getInstance(string type, string prefix = '', array config = array()) : self|bool
static deprecated
since

3.0

deprecated

5.0 Get the model through the MVCFactory instead

Arguments

type

stringThe model type to instantiate

prefix

stringPrefix for the model class name. Optional.

config

arrayConfiguration array for model. Optional.

Response

self|boolA \JModelLegacy instance or false on failure