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

        // get views
        if ($accountId && $propertyId) {
            $profiles = $this->serviceHelper->getService()->management_profiles->listManagementProfiles(
                    $accountId,
                    $propertyId
                );
        } else {
            $profiles = $this->serviceHelper->getService()->management_profiles->listManagementProfiles(
                    $this->getAccountId(),
                    $this->getPropertyId()
                );
        }

        $data = array();
        if (is_array($profiles->getItems())) {
            foreach ($profiles->getItems() as $profile) {
                $data[$profile->name] = array(
                            'profileId' => $profile->id,
                            'profileName' => $profile->name,
                            'created' => $profile->created,
                        );
            }
        }
        ksort($data);

        return $data;
    }
public function getProfiles($accountId = false, $propertyId = false)
    {
        if (!$this->getAccountId() && !$accountId || !$this->getPropertyId() && !$propertyId) {
            return false;
        }

        // get views
        if ($accountId && $propertyId) {
            $profiles = $this->serviceHelper->getService()->management_profiles->listManagementProfiles(
                    $accountId,
                    $propertyId
                );
        } else {
            $profiles = $this->serviceHelper->getService()->management_profiles->listManagementProfiles(
                    $this->getAccountId(),
                    $this->getPropertyId()
                );
        }

        $data = array();
        if (is_array($profiles->getItems())) {
            foreach ($profiles->getItems() as $profile) {
                $data[$profile->name] = array(
                            'profileId' => $profile->id,
                            'profileName' => $profile->name,
                            'created' => $profile->created,
                        );
            }
        }
        ksort($data);

        return $data;
    }
public function getProfiles ( $ accountId = false , $ propertyId = false ) { if ( ! $ this -> getAccountId ( ) && ! $ accountId || ! $ this -> getPropertyId ( ) && ! $ propertyId ) { return false ; } // get views if ( $ accountId && $ propertyId ) { $ profiles = $ this -> serviceHelper -> getService ( ) -> management_profiles -> listManagementProfiles ( $ accountId , $ propertyId ) ; } else { $ profiles = $ this -> serviceHelper -> getService ( ) -> management_profiles -> listManagementProfiles ( $ this -> getAccountId ( ) , $ this -> getPropertyId ( ) ) ; } $ data = array ( ) ; if ( is_array ( $ profiles -> getItems ( ) ) ) { foreach ( $ profiles -> getItems ( ) as $ profile ) { $ data [ $ profile -> name ] = array ( 'profileId' => $ profile -> id , 'profileName' => $ profile -> name , 'created' => $ profile -> created , ) ; } } ksort ( $ data ) ; return $ data ; }
Get a list of all available profiles

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