コード例 #1
0
 /**
  * @param CampaignExecutionEvent $event
  */
 public function onCampaignTriggerActionAddToCompany(CampaignExecutionEvent $event)
 {
     if (!$event->checkContext('lead.addtocompany')) {
         return;
     }
     $company = $event->getConfig()['company'];
     $lead = $event->getLead();
     $somethingHappened = false;
     if (!empty($company)) {
         $somethingHappened = $this->leadModel->addToCompany($lead, $company);
     }
     return $event->setResult($somethingHappened);
 }