public function save(\Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface $optimizer)
    {
        try {
            $this->entityManager->save($optimizer);
        } catch (\Exception $exception) {
            throw new CouldNotSaveException(__(
                'Could not save the optimizer: %1',
                $exception->getMessage()
            ));
        }

        $this->optimizerRepositoryById[$optimizer->getId()] = $optimizer;

        return $optimizer;
    }
public function save(\Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface $optimizer)
    {
        try {
            $this->entityManager->save($optimizer);
        } catch (\Exception $exception) {
            throw new CouldNotSaveException(__(
                'Could not save the optimizer: %1',
                $exception->getMessage()
            ));
        }

        $this->optimizerRepositoryById[$optimizer->getId()] = $optimizer;

        return $optimizer;
    }
public function save ( \ Smile \ ElasticsuiteCatalogOptimizer \ Api \ Data \ OptimizerInterface $ optimizer ) { try { $ this -> entityManager -> save ( $ optimizer ) ; } catch ( \ Exception $ exception ) { throw new CouldNotSaveException ( __ ( 'Could not save the optimizer: %1' , $ exception -> getMessage ( ) ) ) ; } $ this -> optimizerRepositoryById [ $ optimizer -> getId ( ) ] = $ optimizer ; return $ optimizer ; }
save a optimizer

@param \Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface $optimizer Optimizer

@return \Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface
@throws \Magento\Framework\Exception\CouldNotSaveException
save a optimizer