Prestashop 1.7:保存和更新之间的区别?

Prestashop 1.7: Differences between save and update?

在PS17中,对象模型saveupdate方法之间有什么区别吗?

save() 方法调用 update() 如果对象已经存在。

public function save($null_values = false, $auto_date = true)
{
    return (int) $this->id > 0 ? $this->update($null_values) : $this->add($auto_date, $null_values);
}

因此,如果您知道该对象存在,您可以模糊地调用一个或另一个。