在 Symfony 1.4,Doctrine 我有这个来自 schema.yml 的片段
Attendance:
columns:
id: { type: integer(4), primary: true, autoincrement: true }
user_id: { type: integer(4) }
relations:
JoomlaUser: { class: JosUser, local: user_id, foreignAlias: AttendanceList }
和
JosUser:
tableName: jos_users
columns:
id: { type: integer(4), primary: true, autoincrement: true }
relations:
AttendanceList: { class: Attendance, local: id, foreign: user_id }
从 JosUser 确定没有出勤记录的最有效方法是什么。我试过模型/教义/JosUser.class.php
count($this->getAttendanceList())
但这会返回一个所有字段为空但 user_id 的 Doctrine 记录