One to One relationships

apachai | 12 months ago

I know a one-to-many is used with !HasMany, but I want to use the equivalent to has_one in RoR. Does Recess support one-to-one relationships? If so, what's the annotation?



midnightmonster | 11 months ago

AFAIK, for now you just have to use HasMany one side and BelongsTo on the other. Probably wouldn't be crushingly difficult to implement HasOne.

You'd want to look in recess/recess/database/orm. There probably copy annotations/HasManyAnnotation.class.php and relationships/HasManyRelationship.class.php and make the needed changes.

reply



Welcome KrisJordan!

Web: http://www.krisjordan.com/

Location: North Carolina

Edit Profile