protected function updateSlotStatus(array $templateSlots, array $changedSlots)
    {
        try {
            $result = true;
            $this->blockRepository->startTransaction();
            foreach ($changedSlots as $slotName => $repeated) {
                $converter = $this->slotsConverterFactory->createConverter($templateSlots[$slotName], $repeated);
                if (null === $converter) continue;

                $result = $converter->convert();
                if (!$result) {
                    break;
                }
            }

            if ($result) {
                $this->blockRepository->commit();
            } else {
                $this->blockRepository->rollBack();
            }

            return $result;
        } catch (\Exception $e) {
            if (isset($this->blockRepository) && $this->blockRepository !== null) {
                $this->blockRepository->rollBack();
            }

            throw $e;
        }
    }
protected function updateSlotStatus(array $templateSlots, array $changedSlots)
    {
        try {
            $result = true;
            $this->blockRepository->startTransaction();
            foreach ($changedSlots as $slotName => $repeated) {
                $converter = $this->slotsConverterFactory->createConverter($templateSlots[$slotName], $repeated);
                if (null === $converter) continue;

                $result = $converter->convert();
                if (!$result) {
                    break;
                }
            }

            if ($result) {
                $this->blockRepository->commit();
            } else {
                $this->blockRepository->rollBack();
            }

            return $result;
        } catch (\Exception $e) {
            if (isset($this->blockRepository) && $this->blockRepository !== null) {
                $this->blockRepository->rollBack();
            }

            throw $e;
        }
    }
protected function updateSlotStatus ( array $ templateSlots , array $ changedSlots ) { try { $ result = true ; $ this -> blockRepository -> startTransaction ( ) ; foreach ( $ changedSlots as $ slotName => $ repeated ) { $ converter = $ this -> slotsConverterFactory -> createConverter ( $ templateSlots [ $ slotName ] , $ repeated ) ; if ( null === $ converter ) continue ; $ result = $ converter -> convert ( ) ; if ( ! $ result ) { break ; } } if ( $ result ) { $ this -> blockRepository -> commit ( ) ; } else { $ this -> blockRepository -> rollBack ( ) ; } return $ result ; } catch ( \ Exception $ e ) { if ( isset ( $ this -> blockRepository ) && $ this -> blockRepository !== null ) { $ this -> blockRepository -> rollBack ( ) ; } throw $ e ; } }
Updates the slot status for the given slots

@param  array      $templateSlots
@param  array      $changedSlots
@return boolean
@throws \Exception

@api
Updates the slot status for the given slots