Properties

$filename

$filename : string

Output file name

Type

string

$objType

$objType : string

Obj type.

Type

string

$convertBrToNewlines

$convertBrToNewlines : boolean

Options Booleans

Type

boolean

$stripTags

$stripTags : boolean

Options Booleans

Type

boolean

$exportIdent

$exportIdent : string

Export ident for metadata

Type

string

$properties

$properties : array

Output properties

Type

array

$collectionConfig

$collectionConfig : array

CollectionConfig

Type

array

$modelFactory

$modelFactory : \Charcoal\Factory\FactoryInterface

Model factory

Type

\Charcoal\Factory\FactoryInterface

$propertyFactory

$propertyFactory : \Charcoal\Admin\Service\PropertyFactory

Property factory used to display val.

Type

\Charcoal\Admin\Service\PropertyFactory

$proto

$proto : \Charcoal\Admin\Service\Model

Object type proto

Type

\Charcoal\Admin\Service\Model

$collection

$collection : \Charcoal\Admin\Service\Collection

Actual object collection

Type

\Charcoal\Admin\Service\Collection

Methods

__construct()

__construct(array  $data) : \Charcoal\Admin\Service\Exporter

Parameters

array $data

Dependencies.

Throws

\Exception

If missing dependencies.

Returns

\Charcoal\Admin\Service\Exporter

Chainable

export()

export() : void

Export to CSV

collection()

collection() : \Charcoal\Admin\Service\Collection

Actual object collection

Throws

\Exception

If collection config is not set.

Returns

\Charcoal\Admin\Service\Collection —

Collection from the export config.

setExportIdent()

setExportIdent(string  $ident) : \Charcoal\Admin\Service\Exporter

The export config ident Public - Called from the exportAction when a given ident is provided

Parameters

string $ident

Config ident.

Returns

\Charcoal\Admin\Service\Exporter

(chainable)

proto()

proto() : mixed

Object type proto

Throws

\Exception

If no object type is defined.

Returns

mixed —

Object type proto | false.

metadata()

metadata() : mixed

Object metadata

Returns

mixed —

Object metadata.

prepareOptions()

prepareOptions() : \Charcoal\Admin\Service\Exporter

Set all data from the metadata.

Throws

\Exception

If no export ident is specified or found.

\Exception

If no export data is found.

\Exception

If no properties are defined.

Returns

\Charcoal\Admin\Service\Exporter

Chainable.

fileHeaders()

fileHeaders() : array

Returns

array —

File headers.

rows()

rows() : array

CSV rows from collection

Returns

array —

Rows with data from collection.

setFilename()

setFilename(string  $filename) : \Charcoal\Admin\Service\Exporter

Parameters

string $filename

Output filename.

Returns

\Charcoal\Admin\Service\Exporter

(chainable).

setObjType()

setObjType(string  $objType) : \Charcoal\Admin\Service\Exporter

Parameters

string $objType

Object to be exported.

Returns

\Charcoal\Admin\Service\Exporter

(chainable).

setConvertBrToNewlines()

setConvertBrToNewlines(boolean  $bool) : \Charcoal\Admin\Service\Exporter

Convert br to newline?

Parameters

boolean $bool

Convert br to newline.

Returns

\Charcoal\Admin\Service\Exporter

(chainable)

setStripTags()

setStripTags(boolean  $bool) : \Charcoal\Admin\Service\Exporter

Strip tags?

Parameters

boolean $bool

Strip tags.

Returns

\Charcoal\Admin\Service\Exporter

(chainable)

setProperties()

setProperties(array  $properties) : \Charcoal\Admin\Service\Exporter

Output properties

Parameters

array $properties

Properties.

Returns

\Charcoal\Admin\Service\Exporter

Chainable.

setCollectionConfig()

setCollectionConfig(array  $cfg) : \Charcoal\Admin\Service\Exporter

Collection config

Parameters

array $cfg

Collection config.

Returns

\Charcoal\Admin\Service\Exporter

Chainable.

setModelFactory()

setModelFactory(\Charcoal\Factory\FactoryInterface  $factory) : \Charcoal\Admin\Service\Exporter

Set the model factory

Parameters

\Charcoal\Factory\FactoryInterface $factory

Model factory.

Returns

\Charcoal\Admin\Service\Exporter

(chainable)

setPropertyFactory()

setPropertyFactory(\Charcoal\Factory\FactoryInterface  $factory) : \Charcoal\Admin\Service\TableWidget

Parameters

\Charcoal\Factory\FactoryInterface $factory

The property factory, to create properties.

Returns

\Charcoal\Admin\Service\TableWidget —

Chainable

filename()

filename() : string

Returns

string —

Desired filename.

objType()

objType() : string

Returns

string —

Current object type.

convertBrToNewlines()

convertBrToNewlines() : boolean

Returns

boolean —

Convert to newlines.

stripTags()

stripTags() : boolean

Returns

boolean —

Striptags.

exportIdent()

exportIdent() : string

Returns

string —

Export ident.

properties()

properties() : array

Returns

array —

Properties.

collectionConfig()

collectionConfig() : array

Returns

array —

CollectionConfig.

modelFactory()

modelFactory() : \Charcoal\Admin\Service\ModelFactory

Returns

\Charcoal\Admin\Service\ModelFactory —

Model factory.

propertyFactory()

propertyFactory() : \Charcoal\Factory\FactoryInterface

Throws

\Exception

If the property factory was not previously set / injected.

Returns

\Charcoal\Factory\FactoryInterface

brToNewline()

brToNewline(string  $text) : string

Change BR into newlines.

Parameters

string $text

Text.

Returns

string —

Text with newlines.

stripContent()

stripContent(string  $text) : string

Clean output content.

Parameters

string $text

Text to be stripped.

Returns

string —

Stripped text.