Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorkumazatheef
     
    I'm in the process of setting up Akelos for some testing and playing, but before I get there, was wondering if anyone could answer a question for me.

    If I have Posts that has and belongs to many (HABTM) Categories, with a categories_posts join table, how does it handling updating?

    Quite a few other frameworks will delete all associated records in the join table then add new ones, which somewhat makes sense.
    What about for saving extra information in fields into the join table? How easy is it to do that?

    Thanks
    • CommentAuthorkumazatheef
     
    What about for searching through HABTM??

    ex:
    Posts HABTM Tags

    Search for all Posts with a certain Tag.

    How easy is that??
    •  
      CommentAuthorbermi
     

    Akelos creates a habtm join model like CategoryPost which you can use for adding additional fields related to the association. Akelos also deletes join table records before adding new one by default like you pointed.

    Regarding the search, you can do something like:

    $Post->find(array('conditions' => array('_tags.name = ?', $tag), 'include' => 'tags'));