Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/238.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
具有PHP活动记录多对多关系的关联表_Php_Activerecord - Fatal编程技术网

具有PHP活动记录多对多关系的关联表

具有PHP活动记录多对多关系的关联表,php,activerecord,Php,Activerecord,我有三个表:相册(id,name,desc)、类别(id,name,desc)和相册类别(相册id,类别id)。当前使用PHP Active Record时,有两个类: <?php class Category extends ActiveRecord\Model { static $has_many = array( array("albums") ); } <?php class Album extends ActiveRecord\Model

我有三个表:相册(id,name,desc)、类别(id,name,desc)和相册类别(相册id,类别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")
    );
}