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; } }