public function getSegments($all = false)
    {
        if ($all) {
            return $this->segments;
        }
        $segments = [];
        foreach ($this->segments as $segment) {
            if ($segment->isEnabled()) {
                $segments[] = $segment;
            }
        }
        return $segments;
    }