LegacyModelLoaderTrait

Trait which contains the legacy getInstance functionality

deprecated
since

4.0.0

deprecated

4.3 will be removed in 6.0 Will be removed without replacement

package

Joomla CMS

Methods

_createFileName

Create the filename for a resource

_createFileName( type, mixed||string|int parts = []) : 
static deprecated
since

3.0

deprecated

4.3 will be removed in 6.0 Will be removed without replacement

Arguments

type

stringThe resource type to create the filename for.

parts

array<string|int, mixed>An associative array of filename information.

Response

stringThe filename

addTablePath

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

addTablePath( path) : 
static deprecated
since

3.0

deprecated

4.3 will be removed in 6.0 Will be removed without replacement. Get the model through the MVCFactory instead

Arguments

path

mixedThe directory as a string or directories as an array to add.

Response

void

createModelFromComponent

Returns a Model object by loading the component from the prefix.

createModelFromComponent( type,  prefix = '', mixed||string|int config = []) : \Joomla\CMS\MVC\Model\ModelInterface|null
static deprecated
since

4.0.0

deprecated

4.3 will be removed in 6.0 Will be removed without replacement

Arguments

type

stringThe model type to instantiate

prefix

stringPrefix for the model class name. Optional.

config

array<string|int, mixed>Configuration array for model. Optional.

Response

ModelInterface|nullA ModelInterface instance or null on failure

getInstance

Returns a Model object, always creating it

getInstance( type,  prefix = '', mixed||string|int config = []) : self|bool
static deprecated
since

3.0

deprecated

4.3 will be removed in 6.0 Will be removed without replacement. Get the model through the MVCFactory instead Example: Factory::getApplication->bootComponent('com_xxx')->getMVCFactory()->createModel($type, $prefix, $config);

Arguments

type

stringThe model type to instantiate

prefix

stringPrefix for the model class name. Optional.

config

array<string|int, mixed>Configuration array for model. Optional.

Response

self|boolA \JModelLegacy instance or false on failure