jonathangeiger / kohana-jelly

See the link below for the most up-to-date code
https://github.com/creatoro/jelly
MIT License
146 stars 34 forks source link

Foreign Key values #106

Open bmidget opened 14 years ago

bmidget commented 14 years ago

Speaking with Banks, it seems reasonable there should be a way to access the foreign key value directly from a relationship field such as Field_BelongsTo.

Allowing this cuts out the redundant necessity of also creating, for instance, user_id (Field_Integer).

This also makes building forms with already existing data much simpler.

As far as syntax goes, I'm a bit at a loss. Perhaps something like $post->user->get(':foreign') or $post->user->get('value');

Again, I'm not sure about the syntax at all, but the functionality would be very nice.

jonathangeiger commented 14 years ago

Maybe something like

$post->key('user');

?

bmidget commented 14 years ago

That looks great