[MODM-163] @ReferenceMany and Inheritance Created: 01/Mar/12  Updated: 01/Mar/12

Status: Open
Project: Doctrine MongoDB ODM
Component/s: Persister
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: julie sommerville Assignee: Jonathan H. Wage
Resolution: Unresolved Votes: 0
Labels: None
Environment:

php 5.3 macosx 10.7.3 mongodb-odm 1.0 mongodb v2.0.2



 Description   

@ReferenceMany doesn't seem to work when used within a child class unless I specify @InheritanceType("CLASS_PER_COLLECTION") (which is fine b/c that works for our architecture)

Here is an example from our code:

//Parent Class

use Doctrine\Common\Collections\ArrayCollection;

/**

  • @Document(collection="homepages")
  • @ChangeTrackingPolicy("DEFERRED_IMPLICIT")
  • @Indexes({
  • @Index(keys= {"vertical"="asc","ts"="desc"}

    , safe="true"),

  • @Index(keys= {"ts"="desc"}

    , safe="true")

  • })
    */
    class Homepage extends MappedDocument
    {

//** References
/**

  • @ReferenceMany(targetDocument="Post")
  • @var list<Post>
    */
    protected $touts;

}

//Child Class
/**

  • @Document(collection="readmes")
  • @ChangeTrackingPolicy("DEFERRED_IMPLICIT")
  • @Indexes({
  • @Index(keys= {"vertical"="asc"}

    , safe="true")

  • })
    */
    class Readme extends Homepage { //** References /** * @ReferenceMany(targetDocument="Post") * @var list<Post> */ protected $more_touts; }

If I don't add the @InheritanceType annotation the $more_touts data never gets persisted into the DB.
Other types such as @ReferenceOne all work just fine


Generated at Wed Apr 23 08:32:49 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.