Fixed preorder statusflag sync

This commit is contained in:
Frank Schubert
2025-10-07 17:49:10 +02:00
parent 2fd7114aa9
commit d8f7f94fd6
2 changed files with 23 additions and 26 deletions

View File

@@ -9,13 +9,18 @@ class PreorderStatusflag extends mfBaseModel {
if($name == "value") {
if(!$this->preorder_id) return null;
$value = PreorderStatusflagValueModel::getFirst(["preorder_id" => $this->preorder_id, "flag_id" => $this->id]);
$value = mfValuecache::singleton()->get("mfObjectmodel-PreorderStatusflagValue-{$this->code}-".$this->preorder_id);
if(!$value) {
$value = PreorderStatusflagValueModel::create([
"preorder_id" => $this->preorder_id,
"flag_id" => $this->id
]);
$value = PreorderStatusflagValueModel::getFirst(["preorder_id" => $this->preorder_id, "flag_id" => $this->id]);
if (!$value) {
$value = PreorderStatusflagValueModel::create([
"preorder_id" => $this->preorder_id,
"flag_id" => $this->id
]);
}
}
mfValuecache::singleton()->set("mfObjectmodel-PreorderStatusflagValue-{$this->code}-".$this->preorder_id, $value);
$this->value = $value;
return $this->value;
}