How do you go about telling the XML driver what classes should extend a mapped superclass?
You don't have to :)
You can simply create an abstract class (lets name it My\First\BaseClass
) and define a Mapped Superclass in XML:
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping
xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
>
<mapped-superclass name="My\First\BaseClass">
<!-- fields, etc -->
</mapped-superclass>
</doctrine-mapping>
Next have an Entity class extend this Mapped Superclass. You can even have an Entity class extending a Mapped Superclass which in turn extends another Mapped Superclass.
The point is: Doctrine is smart enough to traverse all XML mapping files in order to determine the complete set of mapping metadata, based on class inheritance. You don't need to specify the graph in XML.