class CsvWriter (View source)

A Writer class for Express Entry objects

Properties

protected Writer $writer
protected Date $dateFormatter
private string $datetime_format
private Service|null $siteService
protected EntityManager $entityManager

Methods

__construct(Writer $writer, Date $dateFormatter, EntityManager $entityManager, $datetime_format = DATE_ATOM)

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

getSiteService()

Get the site service instance to use

void
setSiteService(Service $siteService)

Override the site service

Details

__construct(Writer $writer, Date $dateFormatter, EntityManager $entityManager, $datetime_format = DATE_ATOM)

No description

Parameters

Writer $writer
Date $dateFormatter
EntityManager $entityManager
$datetime_format

insertHeaders(Entity $entity)

No description

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

protected Service getSiteService()

Get the site service instance to use

Return Value

Service

void setSiteService(Service $siteService)

Override the site service

Parameters

Service $siteService

Return Value

void