class IPRangesCsvWriter (View source)

Properties

protected Writer $writer

The writer we use to output.

protected int $type

One of the IpAccessControlService::IPRANGETYPE_... constants.

protected Date $dateHelper

The date localization service.

Methods

__construct(Writer $writer, int $type, Date $dateHelper)

No description

insertHeaders()

Insert a header row for this result set.

insertRanges(IPRange[]|IpAccessControlRange[]|Generator $ranges)

Insert a list of IPRange/IpAccessControlRange instances.

insertRange(IPRange|IpAccessControlRange $range)

Insert an IPRange/IpAccessControlRange instance.

array[]|Generator
projectRanges(IPRange[]|IpAccessControlRange[]|Generator $ranges)

A generator that takes a collection of IPRange/IpAccessControlRange ranges and converts it to CSV rows.

string[]
projectRange(IPRange|IpAccessControlRange $range)

Turn an IPRange/IpAccessControlRange instance into an array.

string[]
getHeaders()

Get the headers of the CSV.

Details

__construct(Writer $writer, int $type, Date $dateHelper)

No description

Parameters

Writer $writer

the writer we use to output

int $type

One of the IpAccessControlService::IPRANGETYPE_... constants

Date $dateHelper

the Date localization service

insertHeaders()

Insert a header row for this result set.

insertRanges(IPRange[]|IpAccessControlRange[]|Generator $ranges)

Insert a list of IPRange/IpAccessControlRange instances.

Parameters

IPRange[]|IpAccessControlRange[]|Generator $ranges

insertRange(IPRange|IpAccessControlRange $range)

Insert an IPRange/IpAccessControlRange instance.

Parameters

IPRange|IpAccessControlRange $range

private array[]|Generator projectRanges(IPRange[]|IpAccessControlRange[]|Generator $ranges)

A generator that takes a collection of IPRange/IpAccessControlRange ranges and converts it to CSV rows.

Parameters

IPRange[]|IpAccessControlRange[]|Generator $ranges

Return Value

array[]|Generator

private string[] projectRange(IPRange|IpAccessControlRange $range)

Turn an IPRange/IpAccessControlRange instance into an array.

Parameters

IPRange|IpAccessControlRange $range

Return Value

string[]

private string[] getHeaders()

Get the headers of the CSV.

Return Value

string[]