Removalls and offers revenues
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user