[Solar-talk] _hasOne Help

Rodrigo Moraes rodrigo.moraes at gmail.com
Wed Nov 14 14:41:55 CST 2007


On Nov 14, 2007 6:23 PM, Raymond Kolbe wrote:
> Using your example (not the pastbin, but from above), it returns NULL now
> when trying to get $rest->market->name or $rest->markets->name. Is there
> another way I should try accessing the data?

Hmm, I tested it and it worked: http://pastebin.com/m77267057

It is null probably because it haven't found any related record. Try
to add a "restaurants" record with "market" = 1. Add a record with
"id" = 1 to "markets", and in your example it'll dump the market
"name".

-- rodrigo


More information about the Solar-talk mailing list