protected function processSingleProductSaleElementUpdate($data)
    {
        $event = new ProductSaleElementUpdateEvent(
            $this->getExistingObject(),
            $data['product_sale_element_id']
        );

        $event
            ->setReference($data['reference'])
            ->setPrice($data['price'])
            ->setCurrencyId($data['currency'])
            ->setWeight($data['weight'])
            ->setQuantity($data['quantity'])
            ->setSalePrice($data['sale_price'])
            ->setOnsale($data['onsale'])
            ->setIsnew($data['isnew'])
            ->setIsdefault($data['isdefault'])
            ->setEanCode($data['ean_code'])
            ->setTaxRuleId($data['tax_rule'])
            ->setFromDefaultCurrency($data['use_exchange_rate'])
        ;

        $this->dispatch(TheliaEvents::PRODUCT_UPDATE_PRODUCT_SALE_ELEMENT, $event);

        // Log object modification
        if (null !== $changedObject = $event->getProductSaleElement()) {
            $this->adminLogAppend(
                $this->resourceCode,
                AccessManager::UPDATE,
                sprintf(
                    "Product Sale Element (ID %s) for product reference %s modified",
                    $changedObject->getId(),
                    $event->getProduct()->getRef()
                ),
                $changedObject->getId()
            );
        }
    }
protected function processSingleProductSaleElementUpdate($data)
    {
        $event = new ProductSaleElementUpdateEvent(
            $this->getExistingObject(),
            $data['product_sale_element_id']
        );

        $event
            ->setReference($data['reference'])
            ->setPrice($data['price'])
            ->setCurrencyId($data['currency'])
            ->setWeight($data['weight'])
            ->setQuantity($data['quantity'])
            ->setSalePrice($data['sale_price'])
            ->setOnsale($data['onsale'])
            ->setIsnew($data['isnew'])
            ->setIsdefault($data['isdefault'])
            ->setEanCode($data['ean_code'])
            ->setTaxRuleId($data['tax_rule'])
            ->setFromDefaultCurrency($data['use_exchange_rate'])
        ;

        $this->dispatch(TheliaEvents::PRODUCT_UPDATE_PRODUCT_SALE_ELEMENT, $event);

        // Log object modification
        if (null !== $changedObject = $event->getProductSaleElement()) {
            $this->adminLogAppend(
                $this->resourceCode,
                AccessManager::UPDATE,
                sprintf(
                    "Product Sale Element (ID %s) for product reference %s modified",
                    $changedObject->getId(),
                    $event->getProduct()->getRef()
                ),
                $changedObject->getId()
            );
        }
    }
protected function processSingleProductSaleElementUpdate ( $ data ) { $ event = new ProductSaleElementUpdateEvent ( $ this -> getExistingObject ( ) , $ data [ 'product_sale_element_id' ] ) ; $ event -> setReference ( $ data [ 'reference' ] ) -> setPrice ( $ data [ 'price' ] ) -> setCurrencyId ( $ data [ 'currency' ] ) -> setWeight ( $ data [ 'weight' ] ) -> setQuantity ( $ data [ 'quantity' ] ) -> setSalePrice ( $ data [ 'sale_price' ] ) -> setOnsale ( $ data [ 'onsale' ] ) -> setIsnew ( $ data [ 'isnew' ] ) -> setIsdefault ( $ data [ 'isdefault' ] ) -> setEanCode ( $ data [ 'ean_code' ] ) -> setTaxRuleId ( $ data [ 'tax_rule' ] ) -> setFromDefaultCurrency ( $ data [ 'use_exchange_rate' ] ) ; $ this -> dispatch ( TheliaEvents :: PRODUCT_UPDATE_PRODUCT_SALE_ELEMENT , $ event ) ; // Log object modification if ( null !== $ changedObject = $ event -> getProductSaleElement ( ) ) { $ this -> adminLogAppend ( $ this -> resourceCode , AccessManager :: UPDATE , sprintf ( "Product Sale Element (ID %s) for product reference %s modified" , $ changedObject -> getId ( ) , $ event -> getProduct ( ) -> getRef ( ) ) , $ changedObject -> getId ( ) ) ; } }
Process a single PSE update, using form data array.

@param array $data the form data
Process a single PSE update using form data array .