对于某些特殊实体(我无法分辨哪些实体),当我尝试count($Club->getUmbrellas())
时,我会收到以下错误,$Club->getUmbrellas()
为Doctrine\ORM\PersistentCollection
。
注意:未定义的索引:第401行的/var/www/apache/StudCon/library/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php中的id致命错误:调用非成员函数getValue()第401行/var/www/apache/StudCon/library/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php中的对象
Club
是主要的。ClubClub
扩展Club
ClubUmbrella
扩展Club
ClubUmbrella
和ClubClub
与RelationClubUmbrella
这些是最重要的信息(请询问您是否需要更多信息):
class Club extends \StudCon_Entity
{
/**
* @Column(type="string", length="150")
* @var string
*/
protected $type;
/**
* @Id @GeneratedValue
* @Column(type="bigint")
* @var integer
*/
protected $id;
class ClubClub extends Club
{
/**
* @OneToMany(targetEntity="RelationClubUmbrella", mappedBy="club", indexBy="id")
*/
protected $umbrellas;
class ClubUmbrella extends Club
{
/**
* @OneToMany(targetEntity="RelationClubUmbrella", mappedBy="umbrella")
*/
protected $clubs;
class RelationClubUmbrella
{
const STATUS_REQUESTED = 1;
const STATUS_CONFIRMED = 2;
const STATUS_REJECTED = 3;
/**
* @Column(type="integer")
* @var integer
*/
protected $status;
/**
* @Id
* @ManyToOne(targetEntity="Club")
* @JoinColumn(name="umbrellaid", referencedColumnName="id")
* @var Category
*/
protected $umbrella;
/**
* @Id
* @ManyToOne(targetEntity="Club")
* @JoinColumn(name="clubid", referencedColumnName="id")
* @var Category
*/
protected $club;