gpt4 book ai didi

php - Doctrine 无关系加入

转载 作者:可可西里 更新时间:2023-11-01 07:08:30 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Is this possible to join tables in doctrine ORM without using relations?

我有 2 个类(class) Month 和 Vegetable。他们没有任何关系。

我想玩SQL:SELECT * FROM 月份,蔬菜

在 MySQL 中它工作得很好。我在 Doctrine 中这样尝试:

    $months = Doctrine_Query::create()
->select('m.*, v.*')
->from('month m, vegetable v')
->execute();

当我尝试时,我得到:

"vegetable" with an alias of "v" in your query does not reference the parent component it is related to.

有人知道为什么吗?

有没有可能用 Doctrine 做出我想要的东西?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com