| @@ 498-504 (lines=7) @@ | ||
| 495 | if (isset(static::$propertiesCache[$key])) { |
|
| 496 | /** @var Property $prop */ |
|
| 497 | $prop = static::$propertiesCache[$key]; |
|
| 498 | if (!in_array($prop->property_group_id, $product_groups)) { |
|
| 499 | $objectGroup = new ObjectPropertyGroup(); |
|
| 500 | $objectGroup->object_id = $this->objectProduct->id; |
|
| 501 | $objectGroup->object_model_id = $product->id; |
|
| 502 | $objectGroup->property_group_id = $prop->property_group_id; |
|
| 503 | $objectGroup->save(); |
|
| 504 | } |
|
| 505 | if ($prop->has_static_values) { |
|
| 506 | $psv = PropertyStaticValues::findOne(['value' => $value]); |
|
| 507 | if (empty($psv)) { |
|
| @@ 518-524 (lines=7) @@ | ||
| 515 | $psv = null; |
|
| 516 | } |
|
| 517 | } |
|
| 518 | if (!empty($psv) && !in_array($psv->id, $product_osv)) { |
|
| 519 | $osv = new ObjectStaticValues(); |
|
| 520 | $osv->object_id = $this->objectProduct->id; |
|
| 521 | $osv->object_model_id = $product->id; |
|
| 522 | $osv->property_static_value_id = $psv->id; |
|
| 523 | $osv->save(); |
|
| 524 | } |
|
| 525 | } elseif ($prop->is_eav) { |
|
| 526 | $_key = $prop->property_group_id . ':' . $prop->key; |
|
| 527 | if (isset($product_eav[$_key])) { |
|