protected function initializeProductMediaGallery(array $attr)
    {

        // load the value and the attribute ID
        $value = $attr[MemberNames::VALUE];
        $attributeId = $attr[MemberNames::ATTRIBUTE_ID];

        // query whether the product media gallery entity already exists or not
        if ($entity = $this->loadProductMediaGallery($attributeId, $value)) {
            return $this->mergeEntity($entity, $attr);
        }

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

        // load the value and the attribute ID
        $value = $attr[MemberNames::VALUE];
        $attributeId = $attr[MemberNames::ATTRIBUTE_ID];

        // query whether the product media gallery entity already exists or not
        if ($entity = $this->loadProductMediaGallery($attributeId, $value)) {
            return $this->mergeEntity($entity, $attr);
        }

        // simply return the attributes
        return $attr;
    }
protected function initializeProductMediaGallery ( array $ attr ) { // load the value and the attribute ID $ value = $ attr [ MemberNames :: VALUE ] ; $ attributeId = $ attr [ MemberNames :: ATTRIBUTE_ID ] ; // query whether the product media gallery entity already exists or not if ( $ entity = $ this -> loadProductMediaGallery ( $ attributeId , $ value ) ) { return $ this -> mergeEntity ( $ entity , $ attr ) ; } // simply return the attributes return $ attr ; }
Initialize the product media gallery with the passed attributes and returns an instance.

@param array $attr The product media gallery attributes

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