src/Sulu/Bundle/WebsiteBundle/Analytics/AnalyticsManager.php
private function setData(Analytics $analytics, $webspaceKey, $data)
    {
        $analytics->setTitle($this->getValue($data, 'title'));
        $analytics->setType($this->getValue($data, 'type'));
        $analytics->setContent($this->getValue($data, 'content', ''));
        $analytics->setAllDomains($this->getValue($data, 'allDomains', false));
        $analytics->setWebspaceKey($webspaceKey);

        $analytics->clearDomains();

        if (!$analytics->isAllDomains()) {
            foreach ($this->getValue($data, 'domains', []) as $domain) {
                $domainEntity = $this->findOrCreateNewDomain($domain);
                $analytics->addDomain($domainEntity);
            }
        }
    }
private function setData(Analytics $analytics, $webspaceKey, $data)
    {
        $analytics->setTitle($this->getValue($data, 'title'));
        $analytics->setType($this->getValue($data, 'type'));
        $analytics->setContent($this->getValue($data, 'content', ''));
        $analytics->setAllDomains($this->getValue($data, 'allDomains', false));
        $analytics->setWebspaceKey($webspaceKey);

        $analytics->clearDomains();

        if (!$analytics->isAllDomains()) {
            foreach ($this->getValue($data, 'domains', []) as $domain) {
                $domainEntity = $this->findOrCreateNewDomain($domain);
                $analytics->addDomain($domainEntity);
            }
        }
    }
private function setData ( Analytics $ analytics , $ webspaceKey , $ data ) { $ analytics -> setTitle ( $ this -> getValue ( $ data , 'title' ) ) ; $ analytics -> setType ( $ this -> getValue ( $ data , 'type' ) ) ; $ analytics -> setContent ( $ this -> getValue ( $ data , 'content' , '' ) ) ; $ analytics -> setAllDomains ( $ this -> getValue ( $ data , 'allDomains' , false ) ) ; $ analytics -> setWebspaceKey ( $ webspaceKey ) ; $ analytics -> clearDomains ( ) ; if ( ! $ analytics -> isAllDomains ( ) ) { foreach ( $ this -> getValue ( $ data , 'domains' , [ ] ) as $ domain ) { $ domainEntity = $ this -> findOrCreateNewDomain ( $ domain ) ; $ analytics -> addDomain ( $ domainEntity ) ; } } }
Set data to given key.

@param Analytics $analytics
@param string $webspaceKey
@param array $data
Set data to given key .