public function isOperationValid(OperationInterface $operation)
    {
        if ($this->operationManager->findByMiraklIdAndPaymentVoucherNumber(
            $operation->getMiraklId(),
            $operation->getPaymentVoucher()
        )
        ) {
            throw new AlreadyCreatedOperationException($operation);
        }

        if (!$this->operationManager->isValid($operation)) {
            throw new InvalidOperationException($operation);
        }

        ModelValidator::validate($operation);

        return true;
    }
public function isOperationValid(OperationInterface $operation)
    {
        if ($this->operationManager->findByMiraklIdAndPaymentVoucherNumber(
            $operation->getMiraklId(),
            $operation->getPaymentVoucher()
        )
        ) {
            throw new AlreadyCreatedOperationException($operation);
        }

        if (!$this->operationManager->isValid($operation)) {
            throw new InvalidOperationException($operation);
        }

        ModelValidator::validate($operation);

        return true;
    }
public function isOperationValid ( OperationInterface $ operation ) { if ( $ this -> operationManager -> findByMiraklIdAndPaymentVoucherNumber ( $ operation -> getMiraklId ( ) , $ operation -> getPaymentVoucher ( ) ) ) { throw new AlreadyCreatedOperationException ( $ operation ) ; } if ( ! $ this -> operationManager -> isValid ( $ operation ) ) { throw new InvalidOperationException ( $ operation ) ; } ModelValidator :: validate ( $ operation ) ; return true ; }
Validate an operation

@param OperationInterface $operation
@return bool
@throws AlreadyCreatedOperationException
@throws InvalidOperationException
Validate an operation