project
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 27/12/2017
|
||||
* Time: 17:45
|
||||
*/
|
||||
|
||||
class RemoveProject {
|
||||
|
||||
private $offerID;
|
||||
private $allowDelete = TRUE;
|
||||
|
||||
public function __construct( $projectID )
|
||||
{
|
||||
$this->setProjectID( $projectID );
|
||||
|
||||
$this->handle();
|
||||
}
|
||||
|
||||
public function getAllowDelete()
|
||||
{
|
||||
return $this->allowDelete;
|
||||
}
|
||||
|
||||
private function setProjectID( $customerID )
|
||||
{
|
||||
$this->offerID = $customerID;
|
||||
}
|
||||
|
||||
private function handle()
|
||||
{
|
||||
$this->checkForOffers();
|
||||
}
|
||||
|
||||
private function checkForOffers()
|
||||
{
|
||||
$offers = Offer::whereProjectId($this->setProjectID);
|
||||
|
||||
if( $offers->count > 0 ) $this->allowDelete = FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user