nextras / orm

Orm with clean object design, smart relationship loading and powerful collections.
https://nextras.org/orm
MIT License
309 stars 59 forks source link

Entity::toArray error at PostgreSQL #156

Closed f3l1x closed 8 years ago

f3l1x commented 8 years ago

Version: v1.1.6, maybe also in 2.0

$entity->toArray($entity::TO_ARRAY_RELATIONSHIP_AS_ID);

It generates:

SELECT order.* FROM "order" AS "order" WHERE order.customer_id IN (1)

Error: ERROR: syntax error at or near "order" LINE 1: SELECT order.* FROM "order" AS "order" WHERE "order"."custom...

But it should be:

SELECT "order".* FROM "order" AS "order" WHERE "order"."customer_id" IN (1)

Any idea?

hrach commented 8 years ago

Should be already fixed in 2.0. https://github.com/nextras/orm/commit/9a47965141ca05d305b76724469747d58aeed5c7

f3l1x commented 8 years ago

Great. I have to stay at 1.6 at least a few weeks. Could you please fix it to ~1.1?

hrach commented 8 years ago

Yeah. That's why it's marked as a bug.

hrach commented 8 years ago

I see that the commit is already included in v1.1. So, are you sure you have the correct version?

f3l1x commented 8 years ago

I have had 1.1.6 version, I'm sure. At 2.0 it's oukey.

hrach commented 8 years ago

fixed in 1.1.7