class CsvWriter (View source)

A Writer class for Express Entry objects

Properties

protected Writer $writer
protected Date $dateFormatter

Methods

__construct(Writer $writer, Date $dateFormatter)

No description

insertHeaders(Entity $entity)

No description

insertEntryList(EntryList $list)

Insert all data from the passed EntryList

projectList(EntryList $list)

A generator that takes an EntryList and converts it to CSV rows

array
orderedEntry(array $entry, array $headerKeys)

Return an entry in proper order

array
projectEntry(Entry $entry)

Turn an Entry into an array

getHeaders(Entity $entity)

A generator that returns all headers

Details

__construct(Writer $writer, Date $dateFormatter)

Parameters

Writer $writer
Date $dateFormatter

insertHeaders(Entity $entity)

Parameters

Entity $entity

insertEntryList(EntryList $list)

Insert all data from the passed EntryList

Parameters

EntryList $list

private Generator projectList(EntryList $list)

A generator that takes an EntryList and converts it to CSV rows

Parameters

EntryList $list

Return Value

Generator

private array orderedEntry(array $entry, array $headerKeys)

Return an entry in proper order

Parameters

array $entry
array $headerKeys

Return Value

array

private array projectEntry(Entry $entry)

Turn an Entry into an array

Parameters

Entry $entry

Return Value

array

private Generator getHeaders(Entity $entity)

A generator that returns all headers

Parameters

Entity $entity

Return Value

Generator