I tried to override a package class (orm\relation) to add a possibility to select specific collumns for relations (compare with post http://fuelphp.com/forums/discussion/comment/7081). What is the best way to override this method/class?
I created a class Relation and made my changes. I added it in the app bootstrap file to the autoloader, but I didn't work. After that I added it to the autoloader as last line of code in the bootstrap autoloader (after Fuel::init('config.php'); ) but I didn't work since it couldn't find the original class file (for sure - I overriden the autoloader path).
My Question now is: How can I override a class of a package AND the package should also use my class?
There is currently no way to override package classes, unless the package namespace is aliased to global, like for Fuel\Core and Auth. This is not the case with ORM.
You could try loading the ORM package first, which executes the bootstrap and defines the classes to the autoloader. After that, override the class with a different path.