Symfony1 推进可归档行为无法正常工作(列中的归档\u在插入时未得到更新)
我对推进装置的可架构性有一些问题。由于某些原因,当对象正在存档时,Prope不会将存档时间字段设置为当前日期时间 我的模式:Symfony1 推进可归档行为无法正常工作(列中的归档\u在插入时未得到更新),symfony1,symfony-1.4,propel,Symfony1,Symfony 1.4,Propel,我对推进装置的可架构性有一些问题。由于某些原因,当对象正在存档时,Prope不会将存档时间字段设置为当前日期时间 我的模式: SeminarCustomer: tableName: seminar_customer columns: id: { type: integer, required: true, primaryKey: true, foreignClass: Customer, foreignReference: id, on
SeminarCustomer:
tableName: seminar_customer
columns:
id: { type: integer, required: true, primaryKey: true, foreignClass: Customer, foreignReference: id, onDelete: cascade }
...
office_id: { type: integer, required: false, foreignTable: office, foreignReference: id }
entity_id: { type: integer, required: true, default: 1 }
propel_behaviors:
timestampable: ~
archivable: ~
SeminarCustomer::存档方法:
public function archive(PropelPDO $con = null)
{
if ($this->isNew()) {
throw new PropelException('New objects cannot be archived. You must save the current object before calling archive().');
}
if (!$archive = $this->getArchive($con)) {
$archive = new SeminarCustomerArchive();
$archive->setPrimaryKey($this->getPrimaryKey());
}
$this->copyInto($archive, $deepCopy = false, $makeNew = false);
// NOTE: here should be $archive->setArchivedAt(time());
$archive->save($con);
return $archive;
}
我的研讨会客户存档表中肯定存在存档列
有人知道我做错了什么吗?或者模式中可能有错误
Symfony:1.4.17-DEV
推进:1.6.3
提前谢谢 您可以强制将日志归档为可归档行为的参数吗?它应该是开箱即用的
如果有帮助,请参阅以下文档:
编辑:由修复它应该可以工作,但是。。。看来我在推进中发现了一个错误。我也找到了解决办法。现在我将编写一些单元测试来测试我的错误修复。谢谢!到时我会检查你的公关;