Conversie codeigniter 4

This commit is contained in:
2026-01-09 11:41:28 +01:00
parent dbd8c8aed2
commit f0b9c6ad40
242 changed files with 20034 additions and 346 deletions
+53
View File
@@ -0,0 +1,53 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 10/06/2018
* Time: 17:06
*/
class RemoveInvoice {
private $invoiceID;
private $payments;
private $removeAllowed;
public function __construct( $invoiceID )
{
$this->setInvoiceID( $invoiceID );
$this->handle();
}
public function getRemoveAllowed()
{
return $this->removeAllowed;
}
private function setInvoiceID( $invoiceID )
{
$this->invoiceID = $invoiceID;
}
private function handle()
{
$this->setPayment();
$this->setRemoveAllowed();
}
private function setPayment()
{
$payments = Payment::whereInvoiceId( $this->invoiceID );
$this->payments = $payments->count() == 0 ? TRUE : FALSE;
}
private function setRemoveAllowed()
{
if ( $this->payments === FALSE ) return $this->removeAllowed = FALSE;
$this->removeAllowed = TRUE;
}
}