I have read Doctrine 2 Inheritance Mapping with Association but say if you needed Animal to be an entity in its own right, say for creating option lists.
In this case the Discriminator Column for a Pet is in the species column in the animal table.

So the classes would be something like this.
class Animal
{
$id;
$species;
}
/**
* @Table(name="animal")
* @InheritanceType("JOINED")
* @DiscriminatorColumn(name="species", type="string")
* @DiscriminatorMap({"dog" = "Dog", "cat" = "Cat"})
*/
abstract class Pet
{
$id
$species;
}
class Dog extends Pet { }
class Cat extends Pet { }
class Owner
{
/**
* @OneToMany(targetEntity="Pet")
*/
$pets
}
I see a couple of problems.
the
animaltable doesn't have a foreign key toowner. So the the$petsassociation isn't going to work.AnimalandPetare more or less that same thing. If some one changes something inAnimalthose changes wouldn't be reflected in anyPetsubclasses.
A possible solution to the first problem would be to have an extra table called pet, but there is still an issue with the association, because the discriminator column is still in the animal table and duplicating the column in pet would break normalisation.

I'm not sure to fully understand your problem, but I'll give it a try:
Petbeing anAnimal, it makes sense to make it explicit in your class hierarchy. Note that the abstract classPetcan subclass the concrete classAnimal. This way, you can still instantiate anAnimal, aDogor aCat, but you can't instantiate aPet;Animalroot class can have its own discriminator value, which makes possible to persist it with Doctrine. You can then create and persist aDogor aCat, and even a genericAnimal;Animalneeds a reference to its owner;Ownernow has a one-to-many relationship toAnimal;speciescolumn is a discriminator, and adds no value to your domain model (the class name will tell you whichAnimalyou're dealing with), so I would advise to remove this property.Final note, do you really need a
Petclass? If a Pet has nothing specific over anAnimal(i.e. the class is empty), then you should probably remove it from your class hierarchy.About your database structure, I propose the following changes:
owner_idfromDog&Catto theAnimaltable;animal_idfrom theDog&Cattables; they'll share theidvalue with theAnimaltable (one-to-one).