spadefoot / kohana-orm-leap

An ORM module for the Kohana PHP framework that is designed to work with all major databases.
http://spadefoot.github.io/kohana-orm-leap/
100 stars 25 forks source link

DB_ORM and JOIN #20

Closed nyunyu95 closed 12 years ago

nyunyu95 commented 12 years ago

Hello,

I'm trying to make some join statements with DB_ORM. However, anything seems to work I'm always getting such errors:

"Kohana_InvalidProperty_Exception [ 0 ]: Message: Unable to set the specified property. Reason: Property [...] is either inaccessible or undefined."

We can read on http://orm.spadefootcode.com/tutorials/building-sql-statements/#read : "Both DB_SQL and DB_ORM can join tables. However, DB_ORM cannot return data from such tables."

Does it mean that we only can make join statements with the DB_SQL ?

spadefoot commented 12 years ago

Would you paste an example of what you are trying to accomplish?

In general, a result set generated by DB_ORM will only return models of the specified type; therefore, since a model essentially represents a row in a database table, an instance of a model class will not store any data from the joined tables...for that you will need to use DB_SQL. I will look into updating the Web site's documentation to help clarify this distinction.

nyunyu95 commented 12 years ago

Thanks for your precisions. That's fine for me ! :)