I have two different kinds of objects: Ride and Location.
A Ride has an origin and a destination which are Location objects.
Location does not point back to the Ride.
This means I have a many-to-one uni-directional relationship in doctrine.
How can I make doctrine ensure that I don't have any duplicate Location objects in my database?
For Example: If I create a Ride from Minneapolis, MN to Mankato, MN and persist them I now have stored one Ride and two Location objects in my database.
Now that those are persisted, I go to create another Ride from Mankato, MN to New Ulm, MN and persist them.
Doctrine has duplicated the Location Mankato, MN.
Does doctrine have this functionality, or is it my responsibility to check if I am creating duplicate objects?