Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthortom
    • CommentTimeNov 9th 2007
     

    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
    • CommentTimeNov 9th 2007
     

    lazy loading works. look at this unit test

    add another test if thats not reflecting your issue.

    • CommentAuthortom
    • CommentTimeNov 15th 2007
     

    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

  1.  
    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
    • CommentTimeJul 7th 2008
     
    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.
Add your comments
    Username Password
  • Format comments as