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

    Could someone please point me to an example of defining a many-to-many relationship in Akelos?
    •  
      CommentAuthorbermi
     

    A short example

    class Post extends ActiveRecord{
        var $habtm = 'tags'; // use an array if there are more than one
    }
    
    class Tag extends ActiveRecord{
        var $habtm = 'posts'; // you can also use $has_and_belongs_to_many
    }
    

    Have a look at the testing models and the AkHasAndBelongsToMany tests for more examples