Added some linked data in Order to cache
This commit is contained in:
@@ -15,7 +15,13 @@ class Product extends mfBaseModel {
|
||||
$this->attributes = [];
|
||||
|
||||
// get tech attribs
|
||||
$ptattribs = ProducttechAttributeModel::search(['producttech_id' => $this->producttech_id]);
|
||||
$ptattribs = mfValuecache::singleton()->get("ProducttechAttributes-techid-".$this->producttech_id);
|
||||
if($ptattribs === null) {
|
||||
$ptattribs = ProducttechAttributeModel::search(['producttech_id' => $this->producttech_id]);
|
||||
if(count($ptattribs)) {
|
||||
mfValuecache::singleton()->set("ProducttechAttributes-techid-".$this->producttech_id, $ptattribs);
|
||||
}
|
||||
}
|
||||
// fill atrribs with existing values of product attribs
|
||||
foreach($ptattribs as $pta) {
|
||||
$attrib = ProductAttributeModel::getFirst(['product_id' => $this->id, 'producttechattribute_id' => $pta->id]);
|
||||
|
||||
Reference in New Issue
Block a user