Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/Ecombricks/InventoryInventoryCatalog/Model/SourceItemOption/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/Ecombricks/InventoryInventoryCatalog/Model/SourceItemOption/Delete.php
<?php
/**
 * Copyright © eComBricks. All rights reserved.
 * See LICENSE.txt for license details.
 */
declare(strict_types=1);

namespace Ecombricks\InventoryInventoryCatalog\Model\SourceItemOption;

/**
 * Delete source item options
 */
class Delete implements \Ecombricks\InventoryInventoryCatalog\Api\SourceItemOption\DeleteInterface
{
    
    /**
     * Resource
     * 
     * @var \Ecombricks\InventoryInventoryCatalog\Model\ResourceModel\SourceItemOption\Delete
     */
    protected $resource;
    
    /**
     * Surce item option label
     * 
     * @var \Ecombricks\InventoryInventoryCatalog\Model\SourceItemOption\Label
     */
    protected $sourceItemOptionLabel;
    
    /**
     * Logger
     * 
     * @var \Psr\Log\LoggerInterface
     */
    protected $logger;
    
    /**
     * Constructor
     * 
     * @param \Ecombricks\InventoryInventoryCatalog\Model\ResourceModel\SourceItemOption\Delete $resource
     * @param \Ecombricks\InventoryInventoryCatalog\Model\SourceItemOption\Label $sourceItemOptionLabel
     * @param \Psr\Log\LoggerInterface $logger
     * @return void
     */
    public function __construct(
        \Ecombricks\InventoryInventoryCatalog\Model\ResourceModel\SourceItemOption\Delete $resource,
        \Ecombricks\InventoryInventoryCatalog\Model\SourceItemOption\Label $sourceItemOptionLabel,
        \Psr\Log\LoggerInterface $logger
    )
    {
        $this->resource = $resource;
        $this->sourceItemOptionLabel = $sourceItemOptionLabel;
        $this->logger = $logger;
    }
    
    /**
     * Execute
     * 
     * @param \Magento\InventoryInventoryCatalog\Api\Data\SourceItemOptionInterface[] $sourceItemOptions
     * @return \Ecombricks\InventoryInventoryCatalog\Api\SourceItemOption\DeleteInterface
     */
    public function execute(array $sourceItemOptions): \Ecombricks\InventoryInventoryCatalog\Api\SourceItemOption\DeleteInterface
    {
        $pluralLabel = $this->sourceItemOptionLabel->renderPlural();
        try {
            $this->resource->execute($sourceItemOptions);
        } catch (\Exception $exception) {
            $this->logger->error($exception->getMessage());
            throw new \Magento\Framework\Exception\CouldNotDeleteException(__('Could not delete %1.', $pluralLabel), $exception);
        }
        return $this;
    }
    
}

Spamworldpro Mini