public function getSegments($all = false)
    {
        if ($all) {
            return $this->segments;
        }
        $segments = [];
        foreach ($this->segments as $segment) {
            if ($segment->isEnabled()) {
                $segments[] = $segment;
            }
        }
        return $segments;
    }
public function getSegments($all = false)
    {
        if ($all) {
            return $this->segments;
        }
        $segments = [];
        foreach ($this->segments as $segment) {
            if ($segment->isEnabled()) {
                $segments[] = $segment;
            }
        }
        return $segments;
    }
public function getSegments ( $ all = false ) { if ( $ all ) { return $ this -> segments ; } $ segments = [ ] ; foreach ( $ this -> segments as $ segment ) { if ( $ segment -> isEnabled ( ) ) { $ segments [ ] = $ segment ; } } return $ segments ; }
Returns segments keyed by their internal key.

@param   bool    $all    If all segments should be returned, regardless of status.
@return  array
Returns segments keyed by their internal key .