Remove journal

@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since  2013-03-24

@param  \HarvestCloud\CoreBundle\Entity\PaymentJournal $journal
515389
public function removeJournal(\HarvestCloud\CoreBundle\Entity\PaymentJournal $journal)
    {
        $this->journals->removeElement($journal);
    }
373056
public function removeArticle()
    {
        if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) {
            return;
        }

        if (!$this->getViewConfig()->getShowListmania()) {
            return;
        }

        if (($sArtId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid')) &&
            ($oRecommList = $this->getActiveRecommList())
        ) {
            $oRecommList->removeArticle($sArtId);
        }
        $this->_sThisTemplate = 'page/account/recommendationedit.tpl';
    }
1014263
public function removePosting(\HarvestCloud\CoreBundle\Entity\Posting $posting)
    {
        $this->postings->removeElement($posting);
    }
935456
public function removeProductSubscriptionsAsBuyer(\HarvestCloud\CoreBundle\Entity\ProductSubscription $productSubscription)
    {
        $this->productSubscriptionsAsBuyer->removeElement($productSubscription);
    }
687750
public function detach($entity)
    {
        $this->entityRegistry->deregisterEntity($entity);
        $objectHashId = $this->entityRegistry->getObjectHashId($entity);
        unset($this->scheduledForInsertion[$objectHashId]);
        unset($this->scheduledForUpdate[$objectHashId]);
        unset($this->scheduledForDeletion[$objectHashId]);
    }
1353715
protected function registerJournalConfiguration()
	{
		$journalConfiguration = $this->app->make('AppJournalConfigurations');

		$this->app->instance('AppJournalConfigurations', array_merge($journalConfiguration, $this->app['config']->get('accounting-journal')));
	}
1165202
public function delete(Paper $paper)
    {
        $this->om->remove($paper);
        $this->om->flush();
    }
533723
public function removeDepartamento(\Matudelatower\UbicacionBundle\Entity\Departamento $departamento) {
        $this->departamento->removeElement($departamento);
    }
1028526
public function removeLineItem(\HarvestCloud\CoreBundle\Entity\Payment\PaymentLineItem $lineItem)
    {
        $this->lineItems->removeElement($lineItem);
    }
1192853
public function delete ($Model)
    {
        $entity   = $Model->getEntity();
        $entityId = $entity->getId();

        // Clear cache first
        if (isset($this->cache[$entityId])) {
            unset($this->cache[$entityId]);
        }

        $this->em->remove($entity);
        $this->em->flush();
    }
1005145
public function delete(Task $task): void
    {
        $id = $task->getId();

        $task->setId(null);

        $this->client->delete($this->prepareUrlForKey('delete-task', ['id' => $id]));
    }
303125
public function removeInvoice(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Invoice\Invoice $invoice)
    {
        return $this->invoices->removeElement($invoice);
    }
1139681
public function setJournals(array $journals = [])
    {
        $this->journals = [];
        foreach ($journals as $journal) {
            $this->addJournal($journal);
        }

        return $this;
    }
82754
public function removePaymentAction(Request $request)
    {
        $context = $this->loadContext($request);
        /** @var \Ekyna\Component\Sale\Order\OrderInterface $order */
        $order = $context->getResource();

        $this->isGranted('EDIT', $order);

        if (null === $payment = $order->findPaymentById($request->attributes->get('paymentId'))) {
            throw new NotFoundHttpException('Payment not found.');
        }
        if ($payment->getState() !== PaymentStates::STATE_NEW) {
            throw new NotFoundHttpException('Payment is not new.');
        }

        $redirectPath = $this->generateResourcePath($order);
        $action = $this->generateUrl('ekyna_order_order_admin_payment_remove', [
            'orderId' => $order->getId(),
            'paymentId' => $payment->getId(),
        ]);
        $form = $this->createRemovePaymentForm($action, $redirectPath);

        $form->handleRequest($request);
        if ($form->isValid()) {
            $order->removePayment($payment);

            $event = new OrderEvent($order);
            $this->get('event_dispatcher')->dispatch(OrderEvents::CONTENT_CHANGE, $event);
            if (!$event->isPropagationStopped()) {
                return $this->redirect($redirectPath);
            }
        }

        $this->appendBreadcrumb(
            'order-payment-remove',
            'ekyna_order.payment.button.remove'
        );

        return $this->render('EkynaOrderBundle:Admin/Order/Payment:remove.html.twig', [
            'form' => $form->createView(),
            'order' => $order,
        ]);
    }
558965
public function delete(Transaction $model)
    {
        try {
            $model->delete();
        } catch(\Exception $e) {
            abort(409, 'Cannot delete record');
        }

        \Cache::tags('response')->flush();

        return $this->successJsonResponse();
    }
625226
public function addJournal(\HarvestCloud\CoreBundle\Entity\InvoiceJournal $journal)
    {
        $this->journals[] = $journal;

        $journal->setInvoice($this);

        return $this;
    }
835842
public function remove(Log $log)
    {
        unset($this->logs[spl_object_hash($log)]);
        $this->level = null;
    }