src/Observers/ProductWebsiteUpdateObserver.php
protected function initializeProductWebsite(array $attr)
    {

        // try to load the product website relation with the passed product/website ID
        if ($this->loadProductWebsite($attr[MemberNames::PRODUCT_ID], $attr[MemberNames::WEBSITE_ID])) {
            // throw a runtime exception, if the relation already exists
            throw new \RuntimeException(
                sprintf(
                    'Product website relation %d => %d already exsits',
                    $attr[MemberNames::PRODUCT_ID],
                    $attr[MemberNames::WEBSITE_ID]
                )
            );
        }

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

        // try to load the product website relation with the passed product/website ID
        if ($this->loadProductWebsite($attr[MemberNames::PRODUCT_ID], $attr[MemberNames::WEBSITE_ID])) {
            // throw a runtime exception, if the relation already exists
            throw new \RuntimeException(
                sprintf(
                    'Product website relation %d => %d already exsits',
                    $attr[MemberNames::PRODUCT_ID],
                    $attr[MemberNames::WEBSITE_ID]
                )
            );
        }

        // otherwise simply return the attributes
        return $attr;
    }
protected function initializeProductWebsite ( array $ attr ) { // try to load the product website relation with the passed product/website ID if ( $ this -> loadProductWebsite ( $ attr [ MemberNames :: PRODUCT_ID ] , $ attr [ MemberNames :: WEBSITE_ID ] ) ) { // throw a runtime exception, if the relation already exists throw new \ RuntimeException ( sprintf ( 'Product website relation %d => %d already exsits' , $ attr [ MemberNames :: PRODUCT_ID ] , $ attr [ MemberNames :: WEBSITE_ID ] ) ) ; } // otherwise simply return the attributes return $ attr ; }
Initialize the product website with the passed attributes and returns an instance.

@param array $attr The product website attributes

@return array The initialized product website
@throws \RuntimeException Is thrown, if the attributes can not be initialized
Initialize the product website with the passed attributes and returns an instance .