now Caching Preorder load + auto updating attrib inhouse_cabling_supplied

This commit is contained in:
Frank Schubert
2025-09-26 18:36:01 +02:00
parent 1a66a6aa9f
commit 5d9ae37d83
5 changed files with 88 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ class PreorderStatusflagValue extends mfBaseModel {
private $preorder;
protected function afterSave() {
//echo __METHOD__."\n";
if(!property_exists($this->_old_data, "value") || $this->_old_data->value != $this->data->value) {
$history = PreorderHistoryModel::create([
"preorder_id" => $this->data->preorder_id,
@@ -15,7 +16,10 @@ class PreorderStatusflagValue extends mfBaseModel {
$history->save();
}
$this->getProperty("preorder")->afterSave();
$preorder = $this->getProperty("preorder");
//echo "[{$preorder->_ruid}] flagvalue aftersave: loaded preorder\n";
$preorder->afterSave();
}
public function getProperty($name) {
@@ -23,6 +27,7 @@ class PreorderStatusflagValue extends mfBaseModel {
$classname = ucfirst($name);
$idfield = $name."_id";
//var_dump(mfValuecache::singleton()->cache["mfObjectmodel-$name-".$this->$idfield]);exit;
$this->$name = mfValuecache::singleton()->get("mfObjectmodel-$name-".$this->$idfield);
if(!$this->$name) {
$this->$name = new $classname($this->$idfield);