0 votes

Hi, using Doctrine2 less and less. I am now getting to a point were I want to use Doctrine only for migrations and without any enforced relations. Let me explain.

I'm moving towards a CQRS event sourced system and am replacing 'Enityties' with DDD concepts. Projections and Queries are now simple tables wit hardly any relationships.

Skipper is still great; I noticed I can create a relation and simply remove the 'entity alias'. This would enable me to use skipper to design an overal bounded context that shows some relationships but have doctrine generate almost no real relationships.

Unfortunately removing the alias does not add the required field.

The following block is removed when the 'store' alias is removed from the relationship.

<many-to-one field="store" target-entity="HF\Model\Entity\Commerce\Store">
  <join-columns>
    <join-column name="store_id" referenced-column-name="store_id" nullable="false"/>
  </join-columns>
</many-to-one>

Offcource I still need the store_id column to be present, but the skipper does not generate the following.

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
  <entity name="HF\Model\Entity\Commerce\ArticleGroup" table="read_commerce_articlegroup">
    <id name="articleGroupId" type="string" length="36" column="articlegroup_id"/>
    <field name="ledgerNumber" type="string" length="5" nullable="false" column="ledger_number"/>
    <field name="code" type="string" length="30" nullable="false"/>
    <field name="store_id" type="string" length="36" nullable="false"/>
    <field name="description" type="string" length="250" nullable="true" column="description"/>
  </entity>
</doctrine-mapping>

Now my question: Does or could Skipper support this? Visually available relationships, but generated xml without them

ps. I am aware this is probably an edge case + I hope I made myself clear

Bas

in How To & Manuals by (220 points)

Please log in or register to answer this question.