class PageActivityExporter extends AbstractExporter (View source)

Properties

private Writer $writer

The CSV Writer instance.

from  AbstractExporter
private CategoryInterface|null $category

The attribute category.

from  AbstractExporter
private array|null $attributeKeysAndControllers

The memoized attribute keys and controllers for the attribute category.

from  AbstractExporter
private int $unloadDoctrineEveryTick

Unload doctrine entities every X ticks (0 for never).

from  AbstractExporter
private int|null $ticksUntilUnload

Remaining ticks before unloading Doctrine entities.

from  AbstractExporter
protected Date $dateService

Methods

__construct(Writer $writer, Date $dateService)

Initialize the instance.

$this
setUnloadDoctrineEveryTick(int $value)

Set the number of ticks after which doctrine entities should be unloaded (0 for never).

int
getUnloadDoctrineEveryTick()

Get the number of ticks after which doctrine entities should be unloaded (0 for never).

$this
tick()

Add a tick (to be used to unload Doctrine entities).

$this
insertHeaders()

Insert the header row.

$this
insertObject(ObjectInterface $object)

Insert a row for a specific object instance.

$this
insertList(ItemList $list)

Insert one row for every object in a database list.

string[]|Generator
getStaticHeaders()

Get the list of fixed headers.

string[]|Generator
getStaticFieldValues(ObjectInterface $version)

Get the list of fixed values of an object instance.

getObjectFromListResult(ItemList $list, mixed $listResult)

Override this method if the item returned by an ItemList is not already an ObjectInterface instance.

$this
setWriter(Writer $writer)

Set the CSV Writer instance.

Writer
getWriter()

Get the CSV Writer instance.

$this
setCategory(CategoryInterface $category)

Set the attribute category to be used to export the data.

getCategory()

Get the attribute category to be used to export the data.

string[]|Generator
projectHeaders()

A generator that returns all headers.

string[]|Generator
projectObject(ObjectInterface $object)

A generator that returns all fields of an object instance.

string[][]|Generator
projectList(ItemList $list)

A generator that returns all the rows for an object list.

array
getAttributeKeysAndControllers()

Get a list the attribute keys and controllers for the current category.

unloadDoctrineEntities()

Unload every Doctrine entites, and reset the state of this instance.

string|null
getLocalizedDate(string|null $value = null)

Converts a system string date to a (localized) app string date.

Details

__construct(Writer $writer, Date $dateService)

Initialize the instance.

A dummy category is used to prevent that all kind of page attributes values are added to the CSV as well.

Parameters

Writer $writer

the CSV Writer instance

Date $dateService

$this setUnloadDoctrineEveryTick(int $value)

Set the number of ticks after which doctrine entities should be unloaded (0 for never).

Parameters

int $value

Return Value

$this

int getUnloadDoctrineEveryTick()

Get the number of ticks after which doctrine entities should be unloaded (0 for never).

Return Value

int

$this tick()

Add a tick (to be used to unload Doctrine entities).

Return Value

$this

$this insertHeaders()

Insert the header row.

Return Value

$this

$this insertObject(ObjectInterface $object)

Insert a row for a specific object instance.

Parameters

ObjectInterface $object

Return Value

$this

$this insertList(ItemList $list)

Insert one row for every object in a database list.

Parameters

ItemList $list

Return Value

$this

protected string[]|Generator getStaticHeaders()

Get the list of fixed headers.

Return Value

string[]|Generator

See also

AbstractExporter::getStaticHeaders

protected string[]|Generator getStaticFieldValues(ObjectInterface $version)

Get the list of fixed values of an object instance.

Parameters

ObjectInterface $version

Return Value

string[]|Generator

See also

AbstractExporter::getStaticFieldValues

protected ObjectInterface getObjectFromListResult(ItemList $list, mixed $listResult)

Override this method if the item returned by an ItemList is not already an ObjectInterface instance.

Parameters

ItemList $list

The list that returned the result

mixed $listResult

The value returned from the ItemList

Return Value

ObjectInterface

protected $this setWriter(Writer $writer)

Set the CSV Writer instance.

Parameters

Writer $writer

Return Value

$this

protected Writer getWriter()

Get the CSV Writer instance.

Return Value

Writer

protected $this setCategory(CategoryInterface $category)

Set the attribute category to be used to export the data.

Parameters

CategoryInterface $category

Return Value

$this

protected CategoryInterface|null getCategory()

Get the attribute category to be used to export the data.

Return Value

CategoryInterface|null

protected string[]|Generator projectHeaders()

A generator that returns all headers.

Return Value

string[]|Generator

protected string[]|Generator projectObject(ObjectInterface $object)

A generator that returns all fields of an object instance.

Parameters

ObjectInterface $object

Return Value

string[]|Generator

protected string[][]|Generator projectList(ItemList $list)

A generator that returns all the rows for an object list.

Parameters

ItemList $list

Return Value

string[][]|Generator

protected array getAttributeKeysAndControllers()

Get a list the attribute keys and controllers for the current category.

Return Value

array

protected unloadDoctrineEntities()

Unload every Doctrine entites, and reset the state of this instance.

private string|null getLocalizedDate(string|null $value = null)

Converts a system string date to a (localized) app string date.

Parameters

string|null $value

E.g. '2018-21-31 23:59:59'

Return Value

string|null