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.
    •  
      CommentAuthorfrancois
    • CommentTimeMar 4th 2008
     

    Hi everyboby,

    i'm trying to implement a simple inheritance like that

    class Item extends ActiveRecord {}

    and

    class Book extends Item {}

    class Pencil extends Item {}

    In my database, i have only 2 tables books and pencils.

    When i call the listing action (on book or pencil) from my view , i have an error like "Fatal error: Ooops! Could not fetch details for the table items. in /../akelos-fwk/lib/AkActiveRecord.php on line 2617"

    Why Akelos try to access to the table items and it's possible to bypass that action ?

    Thank's

    Francois

    •  
      CommentAuthorriffed
    • CommentTimeMar 4th 2008
     

    What is the point of extending the item class if they both have different tables?

    •  
      CommentAuthorfrancois
    • CommentTimeMar 5th 2008
     

    Thanks Riffed for your help.

    Now it's working fine

    function __construct(){
         $this->setTableName('books');
         $attributes = (array)func_get_args();
         return $this->init($attributes);
    }
    

    Francois

    • CommentAuthorKaste
    • CommentTimeMar 6th 2008
     

    I think this would be a one-liner, to make the single table inheritance optional. somewhere in ->getTableName ´if blah then´ ....

Add your comments
    Username Password
  • Format comments as