Extending Models

Permalink
How can you extend a model permanently from a package, or can the model only be extended within the package part?

$pkg = Package::getByHandle($this->pkgHandle);
$objEnv = Environment::get();
$objEnv->overrideCoreByPackage('models/block_types.php', $pkg);


Will this only work from within the package, and once I leave the package, and it's relevant blocks, I go back to using the core/model one?

adz
 
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
You can use
Loader::model('model_name');


Then extend it as required or override it.

Rony
adz replied on at Permalink Reply
adz
Thanks Rony, but what I'm after is a complete extension of the model, not just from calling Loader::Model('model', $pkg).

Is there any way that a model I create for a package will always be used primarily in the core system?