Piwik\Segment\

SegmentsList

Manages the global list of segments that can be used.

Segments are added automatically by dimensions as well as through the Segment.addSegments event. Observers for this event should call the addSegment() method to add segments or use any of the other methods to remove segments.

Methods

The class defines the following methods:

addSegment()

Signature

  • It accepts the following parameter(s):

  • It does not return anything or a mixed result.

getSegments()

Get all available segments.

Signature

remove()

Removes one or more segments from the segments list.

Signature

  • It accepts the following parameter(s):
    • $segmentCategory (string) — The segment category id. Can be a translation token eg 'General_Visits' see Segment::getCategoryId().
    • $segmentExpression (string|false) — The segment expression name to remove eg 'pageUrl'. If not supplied, all segments within that category will be removed.
  • It does not return anything or a mixed result.

getSegment()

Signature

  • It accepts the following parameter(s):

    • $segmentExpression (string) — Name of the segment expression. eg pageUrl
  • Returns: Segment|null