protected function initializeProductLink(array $attr)
    {

        // load the product/linked product/link type ID
        $productId = $attr[MemberNames::PRODUCT_ID];
        $linkTypeId = $attr[MemberNames::LINK_TYPE_ID];
        $linkedProductId = $attr[MemberNames::LINKED_PRODUCT_ID];

        // try to load the link with the passed product/linked product/link type ID
        if ($entity = $this->loadProductLink($productId, $linkedProductId, $linkTypeId)) {
            return $this->mergeEntity($entity, $attr);
        }

        // simply return the attributes
        return $attr;
    }
protected function initializeProductLink(array $attr)
    {

        // load the product/linked product/link type ID
        $productId = $attr[MemberNames::PRODUCT_ID];
        $linkTypeId = $attr[MemberNames::LINK_TYPE_ID];
        $linkedProductId = $attr[MemberNames::LINKED_PRODUCT_ID];

        // try to load the link with the passed product/linked product/link type ID
        if ($entity = $this->loadProductLink($productId, $linkedProductId, $linkTypeId)) {
            return $this->mergeEntity($entity, $attr);
        }

        // simply return the attributes
        return $attr;
    }
protected function initializeProductLink ( array $ attr ) { // load the product/linked product/link type ID $ productId = $ attr [ MemberNames :: PRODUCT_ID ] ; $ linkTypeId = $ attr [ MemberNames :: LINK_TYPE_ID ] ; $ linkedProductId = $ attr [ MemberNames :: LINKED_PRODUCT_ID ] ; // try to load the link with the passed product/linked product/link type ID if ( $ entity = $ this -> loadProductLink ( $ productId , $ linkedProductId , $ linkTypeId ) ) { return $ this -> mergeEntity ( $ entity , $ attr ) ; } // simply return the attributes return $ attr ; }
Initialize the product link with the passed attributes and returns an instance.

@param array $attr The product link attributes

@return array The initialized product link
Initialize the product link with the passed attributes and returns an instance .