class Segment (View source)

internal  
 

Represents a segment in a resource template. This is used internally by RelativeResourceTemplate, but is not intended for public use and may change without notice.

Constants

LITERAL_SEGMENT

WILDCARD_SEGMENT

DOUBLE_WILDCARD_SEGMENT

VARIABLE_SEGMENT

Methods

__construct(int $segmentType, string $value = null, string $key = null, RelativeResourceTemplate $template = null, string $separator = '/')

Segment constructor.

string
__toString()

No description

bool
matches(string $value)

Checks if $value matches this Segment.

int
getSegmentType()

No description

string|null
getKey()

No description

string|null
getValue()

No description

getTemplate()

No description

string
getSeparator()

No description

Details

__construct(int $segmentType, string $value = null, string $key = null, RelativeResourceTemplate $template = null, string $separator = '/')

Segment constructor.

Parameters

int $segmentType
string $value
string $key
RelativeResourceTemplate $template
string $separator

The separator that belongs at the end of a segment. Ending segments should use '/'.

Exceptions

ValidationException

string __toString()

No description

Return Value

string

A string representation of the segment.

bool matches(string $value)

Checks if $value matches this Segment.

Parameters

string $value

Return Value

bool

Exceptions

ValidationException

int getSegmentType()

No description

Return Value

int

string|null getKey()

No description

Return Value

string|null

string|null getValue()

No description

Return Value

string|null

RelativeResourceTemplate|null getTemplate()

No description

Return Value

RelativeResourceTemplate|null

string getSeparator()

No description

Return Value

string