Removalls and offers revenues

This commit is contained in:
2018-06-10 17:31:05 +02:00
parent 8fe98e6ccb
commit c539d03fb6
20 changed files with 449 additions and 158 deletions
@@ -0,0 +1,52 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 10/06/2018
* Time: 16:28
*/
class RemoveOffer {
private $offerID;
private $project;
private $removeAllowed;
public function __construct($offerID)
{
$this->setOfferID($offerID);
$this->handle();
}
public function getRemoveAllowed()
{
return $this->removeAllowed;
}
private function setOfferID( $offerID )
{
$this->offerID = $offerID;
}
private function handle()
{
$this->setProject();
$this->setRemoveAllowed();
}
private function setProject()
{
$offer = Offer::Find($this->offerID);
$this->project = is_null($offer->project_id) ? TRUE : FALSE;
}
private function setRemoveAllowed()
{
if( $this->project === FALSE ) return $this->removeAllowed = FALSE;
$this->removeAllowed = TRUE;
}
}