Just working on a project where I have a class called 'Product' and a class called 'Image'. Each product has two types of images, one 'front' image and one 'back' image, so I defined two fields, one called image_front_id and one called image_back_id.
In the method BaseProduct::setUp(), I defined the relation for the front images as follows:
$this->hasOne( 'Image', array ('local' => 'image_front_id', 'foreign' => 'id' ) );
Now, obviously, when I define another 'hasOne' to the class 'Image', but now with the local fieldname of 'image_back_id', this doesn't work right. So my question is: how can I define multiple 'one-to-one' relations to the same class? I've been searching for this for some time now, but I can't seem to find it.