src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ConfigHelper.php
public function getProperties($accountId = false)
    {
        if (!$this->getAccountId() && !$accountId) {
            return false;
        }

        if ($accountId) {
            $webproperties = $this->serviceHelper->getService()->management_webproperties->listManagementWebproperties($accountId);
        } else {
            $webproperties = $this->serviceHelper->getService()->management_webproperties->listManagementWebproperties($this->getAccountId());
        }
        $data = array();

        foreach ($webproperties->getItems() as $property) {
            $profiles = $this->getProfiles($accountId, $property->getId());
            if (count($profiles) > 0) {
                $data[$property->getName()] = array(
                        'propertyId' => $property->getId(),
                        'propertyName' => $property->getName() . ' (' . $property->getWebsiteUrl() . ')',
                    );
            }
        }
        ksort($data);

        return $data;
    }
public function getProperties($accountId = false)
    {
        if (!$this->getAccountId() && !$accountId) {
            return false;
        }

        if ($accountId) {
            $webproperties = $this->serviceHelper->getService()->management_webproperties->listManagementWebproperties($accountId);
        } else {
            $webproperties = $this->serviceHelper->getService()->management_webproperties->listManagementWebproperties($this->getAccountId());
        }
        $data = array();

        foreach ($webproperties->getItems() as $property) {
            $profiles = $this->getProfiles($accountId, $property->getId());
            if (count($profiles) > 0) {
                $data[$property->getName()] = array(
                        'propertyId' => $property->getId(),
                        'propertyName' => $property->getName() . ' (' . $property->getWebsiteUrl() . ')',
                    );
            }
        }
        ksort($data);

        return $data;
    }
public function getProperties ( $ accountId = false ) { if ( ! $ this -> getAccountId ( ) && ! $ accountId ) { return false ; } if ( $ accountId ) { $ webproperties = $ this -> serviceHelper -> getService ( ) -> management_webproperties -> listManagementWebproperties ( $ accountId ) ; } else { $ webproperties = $ this -> serviceHelper -> getService ( ) -> management_webproperties -> listManagementWebproperties ( $ this -> getAccountId ( ) ) ; } $ data = array ( ) ; foreach ( $ webproperties -> getItems ( ) as $ property ) { $ profiles = $ this -> getProfiles ( $ accountId , $ property -> getId ( ) ) ; if ( count ( $ profiles ) > 0 ) { $ data [ $ property -> getName ( ) ] = array ( 'propertyId' => $ property -> getId ( ) , 'propertyName' => $ property -> getName ( ) . ' (' . $ property -> getWebsiteUrl ( ) . ')' , ) ; } } ksort ( $ data ) ; return $ data ; }
Get a list of all available properties

@return array $data A list of all properties
Get a list of all available properties