Last active
December 3, 2016 11:08
-
-
Save webdevilopers/9a2cb92f80fc3fd100be324c65b005ad to your computer and use it in GitHub Desktop.
Doctrine Single Table Inheritance working with YAML service configuration but not XML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Sps\Bundle\PriceQuoteBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* PriceQuoteRequest | |
* | |
* @ORM\Entity(repositoryClass="Sps\PriceQuote\Infrastructure\Persistence\Doctrine\DoctrinePriceQuoteRepository") | |
* @ORM\InheritanceType("SINGLE_TABLE")) | |
* @ORM\DiscriminatorColumn(name="type", type="integer") | |
* @ORM\DiscriminatorMap({ | |
* "1" = "DormerPriceQuote", | |
* "2" = "BayWindowPriceQuote" | |
* }) | |
*/ | |
abstract class PriceQuoteRequest | |
extends AbstractPriceQuote | |
implements PriceQuote | |
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" ?> | |
<container xmlns="http://symfony.com/schema/dic/services" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | |
<services> | |
<service id="sps.price_quote.repository.dormer" | |
class="Doctrine\ORM\EntityRepository"> | |
<factory class="%doctrine.orm.entity_manager.class%" method="getRepository"/> | |
<argument>Plusquam\Bundle\PriceQuoteBundle\Entity\DormerPriceQuote</argument> | |
</service> | |
</services> | |
</container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
sps.price_quote.repository.dormer: | |
class: Doctrine\ORM\EntityRepository | |
factory: [ "%doctrine.orm.entity_manager.class%", getRepository ] | |
arguments: | |
- Sps\Bundle\PriceQuoteBundle\Entity\PriceQuoteRequest | |
public: false | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the YAML configuration works just fine. But XML throws:
Any idea?
Came from: