FuelPhp Relation Query作为单个结果

时间:2015-02-01 09:05:54

标签: php mysql database orm fuelphp

当我使用FuelPHP进行Model_ [表名] :: query() - > relation([Other table])查询时,我得到:

{
    "id": 5,
    "[foreign_key"]: {
        "1": {[Other table row]},
    }
}

有没有办法将数据作为:

{
    "id": 5,
    {[Other table row]},
}

1 个答案:

答案 0 :(得分:0)

简短的回答是否定的,没有。

根据您的使用案例,EAV容器可能很有用,或者您可以覆盖模型中的to_array()方法,以便以您需要的格式提供数据。