Files
dbois/application/libraries/projects/RemoveProject.php
T
2018-01-16 13:36:59 +01:00

43 lines
748 B
PHP

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