protected function dispatchPrepareEvent(SaleInterface $sale)
    {
        if (!$sale instanceof OrderInterface) {
            throw new InvalidArgumentException("Expected instance of " . OrderInterface::class);
        }

        $event = $this->eventDispatcher->createResourceEvent($sale);

        try {
            $this->eventDispatcher->dispatch(OrderEvents::PREPARE, $event);
        } catch (IllegalOperationException $e) {
            return false;
        }

        return true;
    }
protected function dispatchPrepareEvent(SaleInterface $sale)
    {
        if (!$sale instanceof OrderInterface) {
            throw new InvalidArgumentException("Expected instance of " . OrderInterface::class);
        }

        $event = $this->eventDispatcher->createResourceEvent($sale);

        try {
            $this->eventDispatcher->dispatch(OrderEvents::PREPARE, $event);
        } catch (IllegalOperationException $e) {
            return false;
        }

        return true;
    }
protected function dispatchPrepareEvent ( SaleInterface $ sale ) { if ( ! $ sale instanceof OrderInterface ) { throw new InvalidArgumentException ( "Expected instance of " . OrderInterface :: class ) ; } $ event = $ this -> eventDispatcher -> createResourceEvent ( $ sale ) ; try { $ this -> eventDispatcher -> dispatch ( OrderEvents :: PREPARE , $ event ) ; } catch ( IllegalOperationException $ e ) { return false ; } return true ; }
Dispatches the sale prepare event.

@param SaleInterface $sale

@return bool
Dispatches the sale prepare event .