class CsvWriter (View source)

A Writer class for user objects

Properties

protected Writer $writer
protected UserCategory $category
private Date $date
protected string[] $status

Methods

__construct(Writer $writer, UserCategory $category, Date $date)

No description

insertHeaders()

Insert a header row for this result set

insertUserList(UserList $list)

Insert all data from the passed userlist

projectList(UserList $list)

A generator that takes a UserList and converts it to CSV rows

array
projectUser(UserInfo $user)

Turn a user into an array

getHeaders()

A generator that returns all headers

array
getAttributeKeys()

Memoize the attribute keys so that we aren't looking them up over and over

string[]
getTranslatedStatus()

Get the translated status texts

Details

__construct(Writer $writer, UserCategory $category, Date $date)

No description

Parameters

Writer $writer
UserCategory $category
Date $date

insertHeaders()

Insert a header row for this result set

insertUserList(UserList $list)

Insert all data from the passed userlist

Parameters

UserList $list

private Generator projectList(UserList $list)

A generator that takes a UserList and converts it to CSV rows

Parameters

UserList $list

Return Value

Generator

private array projectUser(UserInfo $user)

Turn a user into an array

Parameters

UserInfo $user

Return Value

array

private Generator getHeaders()

A generator that returns all headers

Return Value

Generator

private array getAttributeKeys()

Memoize the attribute keys so that we aren't looking them up over and over

Return Value

array

private string[] getTranslatedStatus()

Get the translated status texts

Return Value

string[]