I have 3 models that I have setup thus far in a simple application I am working on:
到目前为止,我有这些模式:
- UserAccountEntity - Top level Table (Has a One-Many Relationship to UserAccountEntityStrings)
- UserAccountEntityStrings - Child Table (Has a Many-One relation ship to UserAccountEntity and EavAttributes
- EavAttributes - Lookup Table
When I query data from my top level table, I get the schema,association information for the child table. But I do not get any of the persisted data from the child table.
我预计结果是什么,高级模型的数据以及相关儿童模式的数据。 我们非常赞赏这方面的任何帮助。
我正在使用Zend 1.11.10和Doctrine 2 ,这或许是有益的。
这是我所问的:
$users = $em->createQuery( select u from FioboxEntityUserModuleUserAccountEntity u )->execute();
Zend_Debug::dump($users[0]);
这是我的最高级模式:
/**
*
* @param DoctrineCommonCollectionsCollection $property
* @OneToMany(targetEntity="UserAccountEntityStrings",mappedBy="UserAccountEntity", cascade={"persist","remove"})
*/
private $strings;
These are the associations in my child model:
/**
*
* @var UserAccountEntity
* @ManyToOne(targetEntity="UserAccountEntity")
* @JoinColumns({
* @JoinColumn(name="entity_id", referencedColumnName="entity_id")
* })
*/
private $user;
/**
* @var EavAttribute
* @ManyToOne(targetEntity="FioboxEntityEavModuleEavAttributes")
* @JoinColumn(name="attribute_id", referencedColumnName="attribute_id")
*/
private $attributes;