Ejemplo n.º 1
0
 /**
  * [generateCommission description]
  * @param  Devis  $devis [description]
  * @return [type]        [description]
  */
 public function generateCommission(Devis $devis)
 {
     $roles = $devis->getCompany()->getPhotographer()->getRoles();
     if ($devis->getCategory()->getType() == 1) {
         $commission = $this->serviceCommission->getCommissionParticulier();
         $commissionClient = $commission->getCustomer();
     } elseif ($devis->getCategory()->getType() == 2) {
         $commission = $this->serviceCommission->getCommissionEntreprise();
         $commissionClient = $commission->getCustomer();
     }
     if (in_array('ROLE_PHOTOGRAPHER_PREMIUM', $roles)) {
         $commissionPhotographer = $commission->getPremium();
     } else {
         $commissionPhotographer = $commission->getPhotographer();
     }
     $commissionPrestation = new CommissionPrestation();
     $commissionPrestation->setCustomer($commissionClient);
     $commissionPrestation->setPhotographer($commissionPhotographer);
     return $commissionPrestation;
 }
Ejemplo n.º 2
0
 /**
  * [isDevisStudio description]
  * @param  Devis   $devis [description]
  * @return boolean        [description]
  */
 public function isDevisStudio(Devis $devis)
 {
     return $devis->getCategory()->getName() == 'Shooting Studio';
 }