Public Member Functions | |
useRelatedLinks () | |
useGroupedLinks () | |
useUpSellLinks () | |
useCrossSellLinks () | |
getAttributeTypeTable ($type) | |
getProductCollection () | |
getLinkCollection () | |
getAttributes ($type=null) | |
saveProductRelations ($product) | |
saveGroupedLinks ($product) | |
Public Attributes | |
const | LINK_TYPE_RELATED = 1 |
const | LINK_TYPE_GROUPED = 3 |
const | LINK_TYPE_UPSELL = 4 |
const | LINK_TYPE_CROSSSELL = 5 |
Protected Member Functions | |
_construct () | |
Protected Attributes | |
$_attributeCollection = null |
Definition at line 35 of file Link.php.
_construct | ( | ) | [protected] |
Initialize resource
Reimplemented from Varien_Object.
Definition at line 47 of file Link.php.
00048 { 00049 $this->_init('catalog/product_link'); 00050 }
getAttributes | ( | $ | type = null |
) |
Definition at line 110 of file Link.php.
00111 { 00112 if (is_null($type)) { 00113 $type = $this->getLinkTypeId(); 00114 } 00115 return $this->_getResource()->getAttributesByType($type); 00116 }
getAttributeTypeTable | ( | $ | type | ) |
Retrieve table name for attribute type
string | $type |
Definition at line 85 of file Link.php.
00086 { 00087 return $this->_getResource()->getAttributeTypeTable($type); 00088 }
getLinkCollection | ( | ) |
Retrieve link collection
Definition at line 103 of file Link.php.
00104 { 00105 $collection = Mage::getResourceModel('catalog/product_link_collection') 00106 ->setLinkModel($this); 00107 return $collection; 00108 }
getProductCollection | ( | ) |
Retrieve linked product collection
Definition at line 93 of file Link.php.
00094 { 00095 $collection = Mage::getResourceModel('catalog/product_link_product_collection') 00096 ->setLinkModel($this); 00097 return $collection; 00098 }
saveGroupedLinks | ( | $ | product | ) |
saveProductRelations | ( | $ | product | ) |
Save data for product relations
Mage_Catalog_Model_Product | $product |
Definition at line 124 of file Link.php.
00125 { 00126 $data = $product->getRelatedLinkData(); 00127 if (!is_null($data)) { 00128 $this->_getResource()->saveProductLinks($product, $data, self::LINK_TYPE_RELATED); 00129 } 00130 $data = $product->getUpSellLinkData(); 00131 if (!is_null($data)) { 00132 $this->_getResource()->saveProductLinks($product, $data, self::LINK_TYPE_UPSELL); 00133 } 00134 $data = $product->getCrossSellLinkData(); 00135 if (!is_null($data)) { 00136 $this->_getResource()->saveProductLinks($product, $data, self::LINK_TYPE_CROSSSELL); 00137 } 00138 return $this; 00139 }
useCrossSellLinks | ( | ) |
useGroupedLinks | ( | ) |
useRelatedLinks | ( | ) |
useUpSellLinks | ( | ) |
const LINK_TYPE_CROSSSELL = 5 |
const LINK_TYPE_GROUPED = 3 |
const LINK_TYPE_RELATED = 1 |
const LINK_TYPE_UPSELL = 4 |