Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthortom
     

    Hi,

    I'm trying to use single table inheritance, but the type column seems to be ignored. The scenario is like this:

    I have model classes Base, with derived classes SpecialBase and ImportantBase, and a model class Test which $belongs_to = 'base'. Now I'm doing a $tests = $Test->findBySql() that is supposed to find all Test records that have associated a Base of a certain type.

    The findBySql() works as expected, but when I call $test->base->load(), then $test->base->getType(), i always get 'Base', no matter what the type column of the Base record says.

    Any ideas?

    Regards, Tom

    • CommentAuthorKaste
     

    lazy loading works. look at this unit test

    add another test if thats not reflecting your issue.

    • CommentAuthortom
     

    Works, ok. Problem was that I expected the type column to have the same value as returned by gettype(). ( 'ImportantBase') and not 'Important base' in the example)

    Thanks!

    Tom

    • CommentAuthorfrankysanders
     
    I've been trying to get single table inheritance working for a while now and cannot seem to get it working. Does anyone have an example model setup for how one should go about doing this?
    • CommentAuthoroisucf
     
    I've had some issues with STI working on Akelos. Some of it was addressed via this ticket: http://trac.akelos.org/ticket/190

    That fixed the issue with the TYPE column name in the rendered SQL. However, The ID column in the rendered SQL is still not right.