奇怪的Kohana ORM查询 - 查询中的冒号

时间:2013-08-27 11:53:13

标签: php orm pdo kohana

我正在使用kohana orm,但当我使用关系时它会返回“奇怪的”查询:

SELECT 
 city.city_id AS city:city_id, 
 city.country AS city:country, 
 city.city_name AS city:city_name, 
 object.id AS id, object.name AS name, 
 object.title AS title, 
 object.author AS author, 
 object.city AS city, 
 object.description AS description, 
 object.access AS access, 
 object.created AS created 
FROM objects AS object 
LEFT JOIN cities AS city ON (object.id = city.city_id)

奇怪的是,我的意思是在列名称之前使用冒号,并且要链接的列名无效(object.id应为object.city
我的问题是:
我需要在对象模型中更改哪些内容才能将列链接更改为object.city? 列名前的这些冒号是什么意思?

1 个答案:

答案 0 :(得分:2)

最后我找到了解决方案here 我刚刚将'identifier' => '"',添加到我的数据库配置文件(application / config / database.php)中,现在一切正常。我希望它对某人有帮助:))