我有三个表,相册(id,name,desc),Categories(id,name,desc)和albums_in_categories(album_id,category_id)。目前有PHP Active Record,这里有两个类:
<?php
class Category extends ActiveRecord\Model {
static $has_many = array(
array("albums")
);
}
和
<?php
class Album extends ActiveRecord\Model {
static $belongs_to = array(
array("categories")
);
}
现在,我将如何定义关联表(albums_in_categories)以便我的关系完全设置?