Relationships between table objects
Posted: Wed Nov 25, 2009 4:13 pm
I'm working on a system where a HomeOwner can have multiple Pets, Employees, and Vehicles
I have a class for each of those.
I'm wondering which is best for deleting a record:
the reason being that you have to specify WHERE pet_id=X AND ownder_id=X in the pets table in order to be allowed to delete a pet
Same goes for employees and cars.
I have a class for each of those.
I'm wondering which is best for deleting a record:
Code: Select all
$homeOwner->deletePetByID( $petID );
or
$Pets->deleteByID( $petID, $ownerID );Same goes for employees and cars.