public function getEvent($event = [])
    {
        if (!$this->event) {
            $this->event = $event;
            if (isset($event['config'])
                && (empty($event['integration'])
                    || (
                        !empty($event['integration'])
                        && $event['integration'] == $this->getName()
                    )
                )
            ) {
                $this->event['config'] = array_merge($this->settings->getFeatureSettings(), $event['config']);
            }

            if (isset($this->event['campaignEvent']) && !empty($this->event['campaignEvent'])) {
                $campaignEvent             = $this->event['campaignEvent'];
                $this->event['id']         = $campaignEvent['id'];
                $this->event['campaignId'] = $campaignEvent['campaign']['id'];
            }

            // If the campaign event ID is missing, backfill it.
            if (!isset($this->event['id']) || !is_numeric($this->event['id'])) {
                try {
                    $identityMap = $this->em->getUnitOfWork()->getIdentityMap();
                    if (isset($identityMap['Mautic\CampaignBundle\Entity\Event'])) {
                        if (isset($identityMap['Mautic\CampaignBundle\Entity\Campaign']) && !empty($identityMap['Mautic\CampaignBundle\Entity\Campaign'])) {
                            $memoryCampaign = end($identityMap['Mautic\CampaignBundle\Entity\Campaign']);
                            $campaignId     = $memoryCampaign->getId();

                            /** @var \Mautic\CampaignBundle\Entity\Event $leadEvent */
                            foreach ($identityMap['Mautic\CampaignBundle\Entity\Event'] as $leadEvent) {
                                $properties = $leadEvent->getProperties();
                                $campaign   = $leadEvent->getCampaign();
                                if (
                                    $properties['_token'] === $this->event['_token']
                                    && $campaignId == $campaign->getId()
                                ) {
                                    $this->event['id']         = $leadEvent->getId();
                                    $this->event['name']       = $leadEvent->getName();
                                    $this->event['campaignId'] = $campaign->getId();
                                    break;
                                }
                            }
                        }
                    }
                } catch (\Exception $e) {
                }
            }
        }

        return $this->event;
    }
public function getEvent($event = [])
    {
        if (!$this->event) {
            $this->event = $event;
            if (isset($event['config'])
                && (empty($event['integration'])
                    || (
                        !empty($event['integration'])
                        && $event['integration'] == $this->getName()
                    )
                )
            ) {
                $this->event['config'] = array_merge($this->settings->getFeatureSettings(), $event['config']);
            }

            if (isset($this->event['campaignEvent']) && !empty($this->event['campaignEvent'])) {
                $campaignEvent             = $this->event['campaignEvent'];
                $this->event['id']         = $campaignEvent['id'];
                $this->event['campaignId'] = $campaignEvent['campaign']['id'];
            }

            // If the campaign event ID is missing, backfill it.
            if (!isset($this->event['id']) || !is_numeric($this->event['id'])) {
                try {
                    $identityMap = $this->em->getUnitOfWork()->getIdentityMap();
                    if (isset($identityMap['Mautic\CampaignBundle\Entity\Event'])) {
                        if (isset($identityMap['Mautic\CampaignBundle\Entity\Campaign']) && !empty($identityMap['Mautic\CampaignBundle\Entity\Campaign'])) {
                            $memoryCampaign = end($identityMap['Mautic\CampaignBundle\Entity\Campaign']);
                            $campaignId     = $memoryCampaign->getId();

                            /** @var \Mautic\CampaignBundle\Entity\Event $leadEvent */
                            foreach ($identityMap['Mautic\CampaignBundle\Entity\Event'] as $leadEvent) {
                                $properties = $leadEvent->getProperties();
                                $campaign   = $leadEvent->getCampaign();
                                if (
                                    $properties['_token'] === $this->event['_token']
                                    && $campaignId == $campaign->getId()
                                ) {
                                    $this->event['id']         = $leadEvent->getId();
                                    $this->event['name']       = $leadEvent->getName();
                                    $this->event['campaignId'] = $campaign->getId();
                                    break;
                                }
                            }
                        }
                    }
                } catch (\Exception $e) {
                }
            }
        }

        return $this->event;
    }
public function getEvent ( $ event = [ ] ) { if ( ! $ this -> event ) { $ this -> event = $ event ; if ( isset ( $ event [ 'config' ] ) && ( empty ( $ event [ 'integration' ] ) || ( ! empty ( $ event [ 'integration' ] ) && $ event [ 'integration' ] == $ this -> getName ( ) ) ) ) { $ this -> event [ 'config' ] = array_merge ( $ this -> settings -> getFeatureSettings ( ) , $ event [ 'config' ] ) ; } if ( isset ( $ this -> event [ 'campaignEvent' ] ) && ! empty ( $ this -> event [ 'campaignEvent' ] ) ) { $ campaignEvent = $ this -> event [ 'campaignEvent' ] ; $ this -> event [ 'id' ] = $ campaignEvent [ 'id' ] ; $ this -> event [ 'campaignId' ] = $ campaignEvent [ 'campaign' ] [ 'id' ] ; } // If the campaign event ID is missing, backfill it. if ( ! isset ( $ this -> event [ 'id' ] ) || ! is_numeric ( $ this -> event [ 'id' ] ) ) { try { $ identityMap = $ this -> em -> getUnitOfWork ( ) -> getIdentityMap ( ) ; if ( isset ( $ identityMap [ 'Mautic\CampaignBundle\Entity\Event' ] ) ) { if ( isset ( $ identityMap [ 'Mautic\CampaignBundle\Entity\Campaign' ] ) && ! empty ( $ identityMap [ 'Mautic\CampaignBundle\Entity\Campaign' ] ) ) { $ memoryCampaign = end ( $ identityMap [ 'Mautic\CampaignBundle\Entity\Campaign' ] ) ; $ campaignId = $ memoryCampaign -> getId ( ) ; /** @var \Mautic\CampaignBundle\Entity\Event $leadEvent */ foreach ( $ identityMap [ 'Mautic\CampaignBundle\Entity\Event' ] as $ leadEvent ) { $ properties = $ leadEvent -> getProperties ( ) ; $ campaign = $ leadEvent -> getCampaign ( ) ; if ( $ properties [ '_token' ] === $ this -> event [ '_token' ] && $ campaignId == $ campaign -> getId ( ) ) { $ this -> event [ 'id' ] = $ leadEvent -> getId ( ) ; $ this -> event [ 'name' ] = $ leadEvent -> getName ( ) ; $ this -> event [ 'campaignId' ] = $ campaign -> getId ( ) ; break ; } } } } } catch ( \ Exception $ e ) { } } } return $ this -> event ; }
Merges a config from integration_list with feature settings.

@param array $event to merge configuration

@return array|mixed
Merges a config from integration_list with feature settings .