我使用此架构将两个表添加到数据库:
Receiptjob:
columns:
charity_id: integer
sf_guard_user_id: integer
created_at: timestamp
finished_at: timestamp
job_type: string(32)
job_status: integer
relations:
User:
class: sfGuardUser
Charity:
class: Charity
Spende:
class: Spende
refClass: ReceiptjobMap
type: many
local: receiptjob_id
foreign: spenden_id
ReceiptjobMap:
columns:
receiptjob_id: integer
spenden_id: integer
spenden_recurring: string(32)
relations:
Receiptjob:
class: Receiptjob
local: receiptjob_id
foreign: id
onDelete: CASCADE
Spende:
class: Spende
local: spenden_id
一切正常,直到今天早上我启动我的Docker容器。我总是得到这个错误信息:
Uncaught Error: Call to a member function setTableName() on null in /var/www/vendor/lexpress/doctrine1/lib/Doctrine/Record/Abstract.php:140
我将尝试修复错误,但无济于事,至少我建立了一个新分支,再次添加了schema.yml并对其进行了迁移,但是错误仍然存在。...
我做错了什么?
在我的情况下,我遇到了问题,因为我没有在类中调用parent :: _ construct,因为在BaseClass中没有__construct。但是BaseClass扩展了sfDoctrineRecord,并且有一个__construct。因此,这是setTableName在null上运行时的原因。