Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Persister
-
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