get all segments for the saved profile

@return array
967929
public function getProfileSegments()
    {
        $profileSegments = $this
                    ->serviceHelper
                    ->getService()
                    ->management_segments
                    ->listManagementSegments()
                    ->items;

        $builtin = array();
        $own = array();
        foreach ($profileSegments as $segment) {
            if ($segment->type == 'BUILT_IN') {
                $builtin[] = array(
                        'name' => $segment->name,
                        'query' => $segment->segmentId,
                    );
            } else {
                $own[] = array(
                        'name' => $segment->name,
                        'query' => $segment->segmentId,
                    );
            }
        }

        return array('builtin' => $builtin, 'own' => $own);
    }
70962
public function getAllInstances()
    {
        $cacheId = CacheId::pluginAware('ProfileSummaries');
        $cache   = Cache::getTransientCache();

        if (!$cache->contains($cacheId)) {
            $instances = [];

            /**
             * Triggered to add new live profile summaries.
             *
             * **Example**
             *
             *     public function addProfileSummary(&$profileSummaries)
             *     {
             *         $profileSummaries[] = new MyCustomProfileSummary();
             *     }
             *
             * @param ProfileSummaryAbstract[] $profileSummaries An array of profile summaries
             */
            Piwik::postEvent('Live.addProfileSummaries', array(&$instances));

            foreach ($this->getAllProfileSummaryClasses() as $className) {
                $instances[] = new $className();
            }

            /**
             * Triggered to filter / restrict profile summaries.
             *
             * **Example**
             *
             *     public function filterProfileSummary(&$profileSummaries)
             *     {
             *         foreach ($profileSummaries as $index => $profileSummary) {
             *              if ($profileSummary->getId() === 'myid') {}
             *                  unset($profileSummaries[$index]); // remove all summaries having this ID
             *              }
             *         }
             *     }
             *
             * @param ProfileSummaryAbstract[] $profileSummaries An array of profile summaries
             */
            Piwik::postEvent('Live.filterProfileSummaries', array(&$instances));

            $cache->save($cacheId, $instances);
        }

        return $cache->fetch($cacheId);
    }
768062
public function getAll($idSite = false)
    {
        if (!empty($idSite)) {
            Piwik::checkUserHasViewAccess($idSite);
        } else {
            Piwik::checkUserHasSomeViewAccess();
        }

        $userLogin = Piwik::getCurrentUserLogin();

        $model = $this->getModel();
        if(Piwik::hasUserSuperUserAccess()) {
            $segments = $model->getAllSegmentsForAllUsers($idSite);
        } else {
            if (empty($idSite)) {
                $segments = $model->getAllSegments($userLogin);
            } else {
                $segments = $model->getAllSegmentsForSite($idSite, $userLogin);
            }
        }

        $segments = $this->sortSegmentsCreatedByUserFirst($segments);

        return $segments;
    }
508969
public static function loadAll()
  {
    $list = [];
    foreach (self::getProfileList() as $definition) {
      $list[$definition['name']] = self::loadProfileByName($definition['name']);
    }
    return $list;
  }
1199451
public function getProfileSettings($profile)
    {
        $search = $this->repo->createSearch();
        $termQuery = new TermQuery('profile', $profile);
        $search->addQuery($termQuery);
        $search->setSize(1000);

        $settings = $this->repo->findArray($search);

        return $settings;
    }
53179
public function getData($segments){
		$data=new stdClass;
		$data->error=-1;
		//Check privileges.
		$bau=BAdminUsers::getInstance();
		$data->can_view=$bau->can($this->accessgroup,$this->access_view);
		$data->can_edit=$bau->can($this->accessgroup,$this->access_edit);
		if((!$data->can_view)&&(!$data->can_edit)){
			$data->error=ERR_LOW_PRIVS;
			return $data;
			}

		//Get item
		$classname=$this->itemcollection;
		$itmcoll=$classname::getInstance();
		$data->item=$itmcoll->item_get($segments['id']);
		if(empty($data->item)){
			BLog::addToLog('[MVC.Admin.ModelItemEdit] Could not get item!',LL_ERROR);
			$data->error=1;
			return $data;
			}
		$data->do=BRequest::getString('do');
		BLog::addToLog('[MVC.Admin.ModelItemEdit] do='.$data->do);

		$data->saving=(($data->do=='save')||($data->do=='save_exit'));
		$this->fieldsval=array();
		//TODO: set default fields...

		//
		$this->getfilterdata($data);
		if(($data->saving)&&($data->can_edit)){
			BLog::addToLog('[MVC.Admin.ModelItemEdit] setting fields...');
			if(!$this->itemsetfields($data->item)){
				BLog::addToLog('[MVC.Admin.ModelItemEdit] We have some errors during setting fields.',LL_ERROR);
				BLog::addToLog('[MVC.Admin.ModelItemEdit] errors: '.var_export($this->errors,true),LL_ERROR);
				BLog::addToLog('[MVC.Admin.ModelItemEdit] warnings: '.var_export($this->warnings,true),LL_ERROR);
				$data->errors=$this->errors;
				$data->warnings=$this->warnings;
				$data->error=2;
				return $data;
				}
			if(empty($data->errors)){
				BLog::addToLog('[MVC.Admin.ModelItemEdit] Saving to database...');
				$data->item->saveToDB();
				}
			if($data->do=='save_exit'){
				$data->redirect=$this->url_exit;;
				}
			}
		//

		//
		$data->error=0;
		$data->fieldsval=$this->fieldsval;
		$data->errors=$this->errors;
		$data->warnings=$this->warnings;
		return $data;
		}
471220
public function getSteps()
    {
        return array_unique(
            array_map(
                function (Snippet $snippet) {
                    return $snippet->getStep();
                },
                $this->snippets
            ),
            SORT_REGULAR
        );
    }
844358
public function getCustomerSegment()
    {
        $segment = new Varien_Object();

        $segmentValues = $this->_getSegmentValues();

        foreach ($segmentValues as $field => $configCallbackPair) {
            if (is_array($configCallbackPair) && Mage::getStoreConfigFlag($configCallbackPair[0])) {
                $segment->setData($field, $configCallbackPair[1]());
            } elseif (is_string($configCallbackPair)) {
                $segment->setData($field, $configCallbackPair);
            }
        }

        Mage::dispatchEvent('ecomdev_varnish_customer_segment', array('segment' => $segment));
        
        return $segment->getData();
    }
1325078
public function getAllProfileInfo()
    {
        if (empty($this->_profiles)) {
            return '';
        }

        $arrOut = [];
        foreach ($this->_profiles as $name => $val) {
            if (!isset($val['cost'], $val['total'])) {
                continue;
            }
            $arrOut[] = "$name=" . sprintf("%.1f", $val['cost'] * 1000) . '(ms)/' . $val['total'];
        }

        return implode(',', $arrOut);
    }
1353204
public function getParts()
    {
        return array(
            'scheme'   => $this->scheme,
            'user'     => $this->username,
            'pass'     => $this->password,
            'host'     => $this->host,
            'port'     => $this->port,
            'path'     => $this->path,
            'query'    => $this->query,
            'fragment' => $this->fragment,
        );
    }
315573
private function sortSegmentsCreatedByUserFirst($segments)
    {
        $orderedSegments = array();
        foreach($segments as $id => &$segment) {
            if($segment['login'] == Piwik::getCurrentUserLogin()) {
                $orderedSegments[] = $segment;
                unset($segments[$id]);
            }
        }
        foreach($segments as $id => &$segment) {
            if($segment['enable_all_users'] == 1) {
                $orderedSegments[] = $segment;
                unset($segments[$id]);
            }
        }
        foreach($segments as $id => &$segment) {
            $orderedSegments[] = $segment;
        }
        return $orderedSegments;
    }
46589
public function getActiveProfiles()
    {
        if ($this->cache->contains($this->activeProfilesSettingName)) {
            $profiles = $this->cache->fetch($this->activeProfilesSettingName);
        } else {
            $profiles = [];
            $allProfiles = $this->getAllProfiles();

            foreach ($allProfiles as $profile) {
                if (!$profile['active']) {
                    continue;
                }

                $profiles[] = $profile['name'];
            }

            $this->cache->save($this->activeProfilesSettingName, $profiles);
        }

        $profiles = array_merge($profiles, $this->activeProfilesList);

        return $profiles;
    }
1285801
public function getTopLevelSections()
    {
        $this->sortSectionsByDepth();
        $topLevelSections = array();

        foreach ($this->sections as $section) {
            if ($section->getDepth() != 0) {
                break;
            }
            $topLevelSections[] = $section;
        }

        return $topLevelSections;
    }
197774
public function segments()
    {
        $segments = explode('/', $this->decodedPath());

        return array_values(array_filter($segments, function ($value) {
            return $value !== '';
        }));
    }
731781
public function getSegmentsExplode()
	{
		if ($this->_path === null)
			return [];

		$segments = explode('/', $this->_path);

		if (empty(end($segments)))
			array_pop($segments); // this normally indicates that the last character was a '/', which created an empty string in the last array member

		return $segments;
	}
141569
public function getAllSections() {
    	$sections = array();
    	$section = $this->section;
    	do {
    		$sections[] = $section;
    	} while($section = $section->getSectionConfig()->getParentSection());

    	return array_reverse($sections);
    }
222848
public function segments()
    {
        $request = $this->createRequestInstance(self::CAT_SEGMENTS, null, null);

        return $this->client->send($request);
    }