{"$schema":"https://yii2-framework.github.io/docs/reference/reference.schema.json","schemaVersion":1,"package":"csv-export","title":"CSV Export","repository":"https://github.com/yii2-extensions/csv-export","ref":"main","commit":"a5151c095c92aa55c3d9ed8aeb7af8d42e2099f7","generatedAt":"2026-12-03","url":"https://yii2-framework.github.io/docs/extensions/csv-export/reference/","types":{"yii2\\extensions\\csvexport\\Column":{"kind":"class","url":"https://yii2-framework.github.io/docs/extensions/csv-export/reference/column/","summary":"Column is the base class of all `yii2\\extensions\\csvexport\\CsvExporter` column classes.","extends":"yii\\base\\BaseObject","implements":["yii\\base\\Configurable"],"properties":{"content":{"type":"callable(mixed, mixed, int, yii2\\extensions\\csvexport\\Column): mixed|null","default":"null","description":"This is a callable that will be used to generate the content of each cell."},"footer":{"type":"string|null","default":"null","description":"Footer cell content, or `null` to use the exporter fallback."},"grid":{"type":"yii2\\extensions\\csvexport\\CsvExporter","description":"The exporter that owns this column.","virtual":true},"header":{"type":"string|null","default":"null","description":"Header cell content, or `null` to use the exporter fallback."},"visible":{"type":"bool","default":"true","description":"Whether this column is visible. Defaults to true."}},"methods":{"getGrid":{"signature":"public function getGrid(): yii2\\extensions\\csvexport\\CsvExporter","summary":"Returns the exporter that owns this column.","return":{"type":"yii2\\extensions\\csvexport\\CsvExporter","description":"The owning exporter."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the column was not assigned to an exporter."}]},"renderDataCellContent":{"signature":"public function renderDataCellContent(mixed $model, mixed $key, int $index): mixed","summary":"Renders a data cell using the content callback or the exporter fallback.","params":[{"name":"$model","type":"mixed","description":"Data row from the effective source."},{"name":"$key","type":"mixed","description":"Key associated with the data row."},{"name":"$index","type":"int","description":"Zero-based row index across the export."}],"return":{"type":"mixed","description":"The result of `content`, or the exporter's empty-cell value when `content` is unset."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the fallback is needed and the column has no exporter."}]},"renderFooterCellContent":{"signature":"public function renderFooterCellContent(): string","summary":"Renders the footer cell using configured text or the exporter fallback.","return":{"type":"string","description":"The footer text, or the exporter's empty-cell value when the footer is unset or blank."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the fallback is needed and the column has no exporter."}]},"renderHeaderCellContent":{"signature":"public function renderHeaderCellContent(): string","summary":"Renders the header cell using configured text or the exporter fallback.","return":{"type":"string","description":"The header text, or the exporter's empty-cell value when the header is unset or blank."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the fallback is needed and the column has no exporter."}]},"setGrid":{"signature":"public function setGrid(yii2\\extensions\\csvexport\\CsvExporter $grid): void","summary":"Sets the exporter that owns this column.","params":[{"name":"$grid","type":"yii2\\extensions\\csvexport\\CsvExporter","description":"Exporter that renders this column."}],"return":{"type":"void"}}},"inherited":{"methods":{"__call":"yii\\base\\BaseObject","__construct":"yii\\base\\BaseObject","__get":"yii\\base\\BaseObject","__isset":"yii\\base\\BaseObject","__set":"yii\\base\\BaseObject","__unset":"yii\\base\\BaseObject","canGetProperty":"yii\\base\\BaseObject","canSetProperty":"yii\\base\\BaseObject","className":"yii\\base\\BaseObject","hasMethod":"yii\\base\\BaseObject","hasProperty":"yii\\base\\BaseObject","init":"yii\\base\\BaseObject"}}},"yii2\\extensions\\csvexport\\CsvExporter":{"kind":"class","url":"https://yii2-framework.github.io/docs/extensions/csv-export/reference/csvexporter/","summary":"CsvExporter allows export of data into CSV files.","extends":"yii\\base\\Component","implements":["yii\\base\\Configurable"],"properties":{"batchSize":{"type":"int","default":"100","description":"The number of records to be fetched in each batch."},"columns":{"type":"list<string|array<string, mixed>|yii2\\extensions\\csvexport\\Column>","default":"[]","description":"Grid column configuration."},"csvFileConfig":{"type":"array<string, mixed>","default":"[]","description":"Configuration for `yii2\\extensions\\csvexport\\CsvFile` instances created in process."},"dataProvider":{"type":"yii\\data\\DataProviderInterface|null","default":"null","description":"The data provider for the view."},"emptyCell":{"type":"string","default":"''","description":"The HTML display when the content of a cell is empty."},"formatter":{"type":"yii\\i18n\\Formatter","description":"The formatter used to format model attribute values into displayable texts.","virtual":true},"maxEntriesPerFile":{"type":"int|null","default":"null","description":"The maximum entries count allowed in single file."},"nullDisplay":{"type":"string","default":"''","description":"The text to be displayed when formatting a `null` data value."},"query":{"type":"yii\\db\\QueryInterface|null","default":"null","description":"The data source query."},"resultConfig":{"type":"array<string, mixed>","default":"[]","description":"Configuration for `yii2\\extensions\\csvexport\\ExportResult` instance created in process result."},"showFooter":{"type":"bool","default":"false","description":"Whether to show the footer section of the sheet."},"showHeader":{"type":"bool","default":"true","description":"Whether to show the header section of the sheet."}},"methods":{"composeBodyRow":{"signature":"protected function composeBodyRow(list<yii2\\extensions\\csvexport\\Column> $columns, mixed $model, mixed $key, int $index): list<mixed>","summary":"Collects the rendered values of one data row in column order.","params":[{"name":"$columns","type":"list<yii2\\extensions\\csvexport\\Column>","description":"Columns of this export."},{"name":"$model","type":"mixed","description":"Data row from the effective source."},{"name":"$key","type":"mixed","description":"Source key, when available."},{"name":"$index","type":"int","description":"Zero-based row index across the export."}],"return":{"type":"list<mixed>","description":"One rendered cell for each column."},"visibility":"protected"},"composeFooterRow":{"signature":"protected function composeFooterRow(list<yii2\\extensions\\csvexport\\Column> $columns): list<string>","summary":"Collects the footer cell values in column order.","params":[{"name":"$columns","type":"list<yii2\\extensions\\csvexport\\Column>","description":"Columns of this export."}],"return":{"type":"list<string>","description":"One footer cell for each column."},"visibility":"protected"},"composeHeaderRow":{"signature":"protected function composeHeaderRow(list<yii2\\extensions\\csvexport\\Column> $columns): list<string>","summary":"Collects the header cell values in column order.","params":[{"name":"$columns","type":"list<yii2\\extensions\\csvexport\\Column>","description":"Columns of this export."}],"return":{"type":"list<string>","description":"One header cell for each column."},"visibility":"protected"},"createDataColumn":{"signature":"protected function createDataColumn(string $text): yii2\\extensions\\csvexport\\DataColumn","summary":"Creates a `yii2\\extensions\\csvexport\\DataColumn` object based on a string in the format of \"attribute:format:label\".","params":[{"name":"$text","type":"string","description":"The column specification string."}],"return":{"type":"yii2\\extensions\\csvexport\\DataColumn","description":"The column instance"},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the column specification is invalid."}],"visibility":"protected"},"export":{"signature":"public function export(): yii2\\extensions\\csvexport\\ExportResult","summary":"Writes the configured data source to one or more finalized CSV files.","return":{"type":"yii2\\extensions\\csvexport\\ExportResult","description":"The result that owns the files and handles delivery."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the data source, columns, file limit, writer or result configuration is invalid."}]},"getFormatter":{"signature":"public function getFormatter(): yii\\i18n\\Formatter","summary":"Resolves the configured formatter or uses the Yii application's formatter.","return":{"type":"yii\\i18n\\Formatter","description":"The formatter, cached after the first resolution."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if no formatter can be resolved."}]},"initColumns":{"signature":"protected function initColumns(mixed $model): list<yii2\\extensions\\csvexport\\Column>","summary":"Builds a separate schema for this export.","params":[{"name":"$model","type":"mixed","description":"First data row, used to infer columns and labels, or `null` for an empty source."}],"return":{"type":"list<yii2\\extensions\\csvexport\\Column>","description":"Visible columns bound to this exporter."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if a column configuration or an inferred column name is invalid."}],"visibility":"protected"},"setFormatter":{"signature":"public function setFormatter(array<string, mixed>|yii\\i18n\\Formatter $formatter): void","summary":"Sets the formatter for column values. Configuration is resolved on first use.","params":[{"name":"$formatter","type":"array<string, mixed>|yii\\i18n\\Formatter","description":"Formatter configuration or instance."}],"return":{"type":"void"}}},"inherited":{"properties":{"behaviors":"yii\\base\\Component"},"methods":{"__call":"yii\\base\\Component","__clone":"yii\\base\\Component","__construct":"yii\\base\\BaseObject","__get":"yii\\base\\Component","__isset":"yii\\base\\Component","__set":"yii\\base\\Component","__unset":"yii\\base\\Component","attachBehavior":"yii\\base\\Component","attachBehaviors":"yii\\base\\Component","behaviors":"yii\\base\\Component","canGetProperty":"yii\\base\\Component","canSetProperty":"yii\\base\\Component","className":"yii\\base\\BaseObject","detachBehavior":"yii\\base\\Component","detachBehaviors":"yii\\base\\Component","ensureBehaviors":"yii\\base\\Component","getBehavior":"yii\\base\\Component","getBehaviors":"yii\\base\\Component","hasEventHandlers":"yii\\base\\Component","hasMethod":"yii\\base\\Component","hasProperty":"yii\\base\\Component","init":"yii\\base\\BaseObject","off":"yii\\base\\Component","on":"yii\\base\\Component","trigger":"yii\\base\\Component"}}},"yii2\\extensions\\csvexport\\CsvFile":{"kind":"class","url":"https://yii2-framework.github.io/docs/extensions/csv-export/reference/csvfile/","summary":"CsvFile represents the CSV file.","extends":"yii\\base\\BaseObject","implements":["yii\\base\\Configurable"],"properties":{"cellDelimiter":{"type":"string","default":"','","description":"Delimiter between the CSV file cells."},"enclosure":{"type":"string","default":"'\"'","description":"The cell content enclosure."},"encoding":{"type":"string","default":"'UTF-8'","description":"Output encoding. Input text for UTF-16 export must be UTF-8."},"entriesCount":{"type":"int","default":"0","description":"The count of entries written into the file."},"fileHandler":{"type":"resource|null","default":"null","description":"Stream for the active write, or `null` when no stream is open.","visibility":"protected"},"name":{"type":"string","default":"''","description":"The path of the file. A standalone CSV survives destruction."},"rowDelimiter":{"type":"string","default":"\"\\r\\n\"","description":"Delimiter between the CSV file rows."},"spreadsheetSafe":{"type":"bool","default":"false","description":"Prefixes formula-like text with an apostrophe for spreadsheet import."},"writeBom":{"type":"bool|string|null","default":"false","description":"Writes the encoding's BOM when enabled, or a supplied literal prefix."}},"methods":{"__destruct":{"signature":"public function __destruct(): mixed","summary":"Attempts to finalize an open stream without reporting I/O errors.","return":{"type":"mixed"}},"close":{"signature":"public function close(): bool","summary":"Finalizes an open CSV and checks that buffered bytes were flushed.","return":{"type":"bool","description":"Always `true`."},"throws":[{"type":"yii\\base\\Exception","description":"if flushing or closing the file fails."}]},"composeRowContent":{"signature":"protected function composeRowContent(array<array-key, mixed>|object $rowData): string","summary":"Encodes the cells and prepends a record separator after the first row.","params":[{"name":"$rowData","type":"array<array-key, mixed>|object","description":"Cell values: an array, a `Traversable` or public properties."}],"return":{"type":"string","description":"The encoded record."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if a cell value cannot be encoded."}],"visibility":"protected"},"delete":{"signature":"public function delete(): bool","summary":"Removes the named file and ends the writer's lifecycle.","return":{"type":"bool","description":"Whether the file is absent after the call."},"throws":[{"type":"yii\\base\\Exception","description":"if flushing or closing the file fails."}]},"encodeValue":{"signature":"protected function encodeValue(mixed $value): string","summary":"Converts supported cell types and applies the selected dialect.","params":[{"name":"$value","type":"mixed","description":"Scalar, `null` or `Stringable` cell value."}],"return":{"type":"string","description":"The cell text, enclosed and escaped when an enclosure is set. An unquoted cell contains a delimiter or line break."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the type is unsupported, the spreadsheet-safe check gets non-UTF-8 text, or"}],"visibility":"protected"},"isComplete":{"signature":"public function isComplete(): bool","summary":"Indicates that the finalized file can be included in a result.","return":{"type":"bool","description":"Whether the file was closed without a failure and is readable."}},"open":{"signature":"public function open(): bool","summary":"Opens the CSV for writing and allows retry after a failed open.","return":{"type":"bool","description":"Always `true`."},"throws":[{"type":"LogicException","description":"if the writer was closed or a write failed."},{"type":"yii\\base\\InvalidConfigException","description":"if the dialect is invalid."},{"type":"yii\\base\\Exception","description":"if the directory or the file cannot be created."}]},"writeContent":{"signature":"protected function writeContent(string $content): int","summary":"Writes the given content into the file.","params":[{"name":"$content","type":"string","description":"Content to be written."}],"return":{"type":"int","description":"The number of bytes written."},"throws":[{"type":"yii\\base\\Exception","description":"on failure."}],"visibility":"protected"},"writeRow":{"signature":"public function writeRow(array<array-key, mixed>|object $rowData): int","summary":"Writes a complete CSV record.","params":[{"name":"$rowData","type":"array<array-key, mixed>|object","description":"Cell values: an array, a `Traversable` or public properties."}],"return":{"type":"int","description":"The byte count of the record, without the BOM."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the dialect, a cell value or the text to transcode is invalid."},{"type":"LogicException","description":"if the writer was closed or a write failed."},{"type":"yii\\base\\Exception","description":"if the file cannot be opened or written."}]}},"inherited":{"methods":{"__call":"yii\\base\\BaseObject","__construct":"yii\\base\\BaseObject","__get":"yii\\base\\BaseObject","__isset":"yii\\base\\BaseObject","__set":"yii\\base\\BaseObject","__unset":"yii\\base\\BaseObject","canGetProperty":"yii\\base\\BaseObject","canSetProperty":"yii\\base\\BaseObject","className":"yii\\base\\BaseObject","hasMethod":"yii\\base\\BaseObject","hasProperty":"yii\\base\\BaseObject","init":"yii\\base\\BaseObject"}}},"yii2\\extensions\\csvexport\\DataColumn":{"kind":"class","url":"https://yii2-framework.github.io/docs/extensions/csv-export/reference/datacolumn/","summary":"DataColumn is the default column type for `yii2\\extensions\\csvexport\\CsvExporter`.","extends":"yii2\\extensions\\csvexport\\Column","implements":["yii\\base\\Configurable"],"properties":{"attribute":{"type":"string|null","default":"null","description":"The attribute name associated with this column. When neither `$content` nor `$value` is specified, the value of the specified attribute will be retrieved from each data model and displayed."},"format":{"type":"string|array<int, mixed>","default":"'raw'","description":"Yii formatter name or format with arguments, such as `['date', 'php:Y-m-d']`."},"label":{"type":"string|null","default":"null","description":"Header label when no explicit header is set. When unset, the column uses the label model's attribute label or humanizes the attribute name."},"labelModel":{"type":"yii\\base\\Model|null","description":"Model whose attribute labels supply headers, or `null` to use humanized attribute names.","access":"write-only","virtual":true},"value":{"type":"string|callable(mixed, mixed, int, yii2\\extensions\\csvexport\\DataColumn): mixed|null","default":"null","description":"An anonymous function or a string that is used to determine the value to display in the current column."}},"methods":{"getDataCellValue":{"signature":"public function getDataCellValue(mixed $model, mixed $key, int $index): mixed","summary":"Returns the data cell value.","params":[{"name":"$model","type":"mixed","description":"Data row from the effective source."},{"name":"$key","type":"mixed","description":"Key associated with the data row."},{"name":"$index","type":"int","description":"Zero-based row index across the export."}],"return":{"type":"mixed","description":"The unformatted value, or `null` when neither `value` nor `attribute` is set."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if an attribute is read from a row that is neither an array nor an object."}]},"renderDataCellContent":{"signature":"public function renderDataCellContent(mixed $model, mixed $key, int $index): mixed","summary":"Renders the formatted cell value, or the result of `content` when it is set.","params":[{"name":"$model","type":"mixed","description":"Data row from the effective source."},{"name":"$key","type":"mixed","description":"Key associated with the data row."},{"name":"$index","type":"int","description":"Zero-based row index across the export."}],"return":{"type":"mixed","description":"The formatted value, the exporter's `nullDisplay` for a `null` value, or the result of `content`."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if an attribute is read from a scalar row, or no exporter or formatter exists."}]},"renderHeaderCellContent":{"signature":"public function renderHeaderCellContent(): string","summary":"Renders the first available of `header`, `label`, the model's attribute label and a humanized attribute name.","return":{"type":"string","description":"The header text, or the exporter's empty-cell value when nothing names the column."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the fallback is needed and the column has no exporter."}]},"setLabelModel":{"signature":"public function setLabelModel(yii\\base\\Model|null $model): void","summary":"Sets the label context from the effective source of this export.","params":[{"name":"$model","type":"yii\\base\\Model|null","description":"Model whose attribute labels supply headers, or `null` to use humanized attribute names."}],"return":{"type":"void"}}},"inherited":{"properties":{"content":"yii2\\extensions\\csvexport\\Column","footer":"yii2\\extensions\\csvexport\\Column","grid":"yii2\\extensions\\csvexport\\Column","header":"yii2\\extensions\\csvexport\\Column","visible":"yii2\\extensions\\csvexport\\Column"},"methods":{"__call":"yii\\base\\BaseObject","__construct":"yii\\base\\BaseObject","__get":"yii\\base\\BaseObject","__isset":"yii\\base\\BaseObject","__set":"yii\\base\\BaseObject","__unset":"yii\\base\\BaseObject","canGetProperty":"yii\\base\\BaseObject","canSetProperty":"yii\\base\\BaseObject","className":"yii\\base\\BaseObject","getGrid":"yii2\\extensions\\csvexport\\Column","hasMethod":"yii\\base\\BaseObject","hasProperty":"yii\\base\\BaseObject","init":"yii\\base\\BaseObject","renderFooterCellContent":"yii2\\extensions\\csvexport\\Column","setGrid":"yii2\\extensions\\csvexport\\Column"}}},"yii2\\extensions\\csvexport\\ExportResult":{"kind":"class","url":"https://yii2-framework.github.io/docs/extensions/csv-export/reference/exportresult/","summary":"Owns the private workspace and delivers the files produced by an export.","extends":"yii\\base\\BaseObject","implements":["yii\\base\\Configurable"],"properties":{"archiver":{"type":"callable(list<string>, string): string|null","default":"null","description":"Alternative archiver receiving the finalized CSV paths and workspace path."},"basePath":{"type":"string","default":"'@runtime/csv-export'","description":"Parent directory or Yii alias for private export workspaces."},"csvFiles":{"type":"list<yii2\\extensions\\csvexport\\CsvFile>","default":"[]","description":"Writers registered with this result, in export order."},"dirName":{"type":"string","description":"The private directory.","virtual":true},"fileBaseName":{"type":"string","default":"'data'","description":"Base name used for the numbered CSV files and the default ZIP archive."},"forceArchive":{"type":"bool","default":"false","description":"Archives even a single CSV when enabled."},"resultFileName":{"type":"string|null","description":"The finalized result path.","access":"read-only","virtual":true}},"methods":{"__destruct":{"signature":"public function __destruct(): mixed","summary":"Attempts to release the workspace without reporting cleanup errors.","return":{"type":"mixed"}},"archiveFiles":{"signature":"protected function archiveFiles(list<string> $files): string","summary":"Archives finalized CSV files with the configured archiver or the built-in ZIP writer.","params":[{"name":"$files","type":"list<string>","description":"The absolute paths of the finalized CSV files."}],"return":{"type":"string","description":"The archive path."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the built-in ZIP writer is selected and the ZIP extension is missing."},{"type":"yii\\base\\Exception","description":"if creating or publishing the archive fails."}],"visibility":"protected"},"copy":{"signature":"public function copy(string $destinationFileName): bool","summary":"Publishes the result outside the workspace and retains the temporary files.","params":[{"name":"$destinationFileName","type":"string","description":"Destination path or Yii alias."}],"return":{"type":"bool","description":"Whether a result was published."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the destination is inside the private workspace."},{"type":"yii\\base\\Exception","description":"if the result, destination directory or temporary delivery file cannot be prepared."}]},"createZipArchive":{"signature":"protected function createZipArchive(): ZipArchive","summary":"Creates an unopened archive writer for the built-in archiver.","return":{"type":"ZipArchive","description":"The archive writer."},"visibility":"protected"},"delete":{"signature":"public function delete(): bool","summary":"Finalizes registered writers, removes the owned workspace and releases its lock.","return":{"type":"bool","description":"Whether a workspace had been allocated."},"throws":[{"type":"yii\\base\\Exception","description":"if finalizing a writer or cleaning up fails."}]},"getDirName":{"signature":"public function getDirName(): string","summary":"Creates and locks the private workspace on first access.","return":{"type":"string","description":"The absolute workspace path."},"throws":[{"type":"yii\\base\\Exception","description":"if the workspace or its lock cannot be prepared."}]},"getResultFileName":{"signature":"public function getResultFileName(): string|null","summary":"Returns the finalized CSV or archive, creating the archive if needed.","return":{"type":"string|null","description":"Absolute result path, or `null` if no writers were registered."},"throws":[{"type":"yii\\base\\Exception","description":"if an input is incomplete, unreadable or outside the workspace, or archiving fails."},{"type":"yii\\base\\InvalidConfigException","description":"if the default archiver is needed but the ZIP extension is unavailable."}]},"move":{"signature":"public function move(string $destinationFileName): bool","summary":"Publishes the result outside the workspace and cleans up after a successful copy.","params":[{"name":"$destinationFileName","type":"string","description":"Destination path or Yii alias."}],"return":{"type":"bool","description":"Whether a result was published."}},"newCsvFile":{"signature":"public function newCsvFile(array<string, mixed> $config = []): yii2\\extensions\\csvexport\\CsvFile","summary":"Registers a writer with a numbered CSV path in the private workspace without opening it.","params":[{"name":"$config","type":"array<string, mixed>","default":"[]","optional":true,"description":"Writer options, optionally including a subclass in `class`."}],"return":{"type":"yii2\\extensions\\csvexport\\CsvFile","description":"The registered, unopened writer."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the writer class or file base name is invalid."},{"type":"yii\\base\\Exception","description":"if the workspace or its lock cannot be prepared."}]},"prepareDestinationFileName":{"signature":"protected function prepareDestinationFileName(string $destinationFileName): string","summary":"Resolves the destination alias and creates its parent directory when needed.","params":[{"name":"$destinationFileName","type":"string","description":"Destination path or Yii alias."}],"return":{"type":"string","description":"The absolute destination path, with its parent directory resolved."},"throws":[{"type":"yii\\base\\Exception","description":"if the destination directory cannot be prepared."}],"visibility":"protected"},"purgeExpired":{"signature":"public static function purgeExpired(string $basePath, int $ageInSeconds): int","summary":"Removes unlocked workspaces whose lease file is older than the retention period.","params":[{"name":"$basePath","type":"string","description":"Trusted parent directory or Yii alias."},{"name":"$ageInSeconds","type":"int","description":"Positive retention period in seconds."}],"return":{"type":"int","description":"The number of workspaces removed."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if the retention period is not positive."},{"type":"yii\\base\\Exception","description":"if the parent directory cannot be read."}],"static":true},"saveAs":{"signature":"public function saveAs(string $file, bool $deleteTempFile = true): bool","summary":"Publishes the result, removing temporary files by default.","params":[{"name":"$file","type":"string","description":"Destination path or Yii alias."},{"name":"$deleteTempFile","type":"bool","default":"true","optional":true,"description":"Whether to clean up after a successful copy."}],"return":{"type":"bool","description":"Whether a result was published."}},"send":{"signature":"public function send(string|null $name = null, array<string, mixed> $options = []): yii\\web\\Response","summary":"Prepares a web download and schedules workspace cleanup after the response is sent.","params":[{"name":"$name","type":"string|null","default":"null","optional":true,"description":"Download name without directories, or `null` to use the result file name."},{"name":"$options","type":"array<string, mixed>","default":"[]","optional":true,"description":"Options passed to the response's file sender."}],"return":{"type":"yii\\web\\Response","description":"The application response, prepared to send the file."},"throws":[{"type":"yii\\base\\InvalidConfigException","description":"if no Yii web application is active or the download name is invalid."},{"type":"LogicException","description":"if there is no finalized result to send."}]},"setDirName":{"signature":"public function setDirName(string $directory): void","summary":"Sets the parent directory before the workspace is created.","params":[{"name":"$directory","type":"string","description":"Parent directory or Yii alias."}],"return":{"type":"void"},"throws":[{"type":"LogicException","description":"if the workspace already exists."}]}},"inherited":{"methods":{"__call":"yii\\base\\BaseObject","__construct":"yii\\base\\BaseObject","__get":"yii\\base\\BaseObject","__isset":"yii\\base\\BaseObject","__set":"yii\\base\\BaseObject","__unset":"yii\\base\\BaseObject","canGetProperty":"yii\\base\\BaseObject","canSetProperty":"yii\\base\\BaseObject","className":"yii\\base\\BaseObject","hasMethod":"yii\\base\\BaseObject","hasProperty":"yii\\base\\BaseObject","init":"yii\\base\\BaseObject"}}},"yii2\\extensions\\csvexport\\SerialColumn":{"kind":"class","url":"https://yii2-framework.github.io/docs/extensions/csv-export/reference/serialcolumn/","summary":"SerialColumn displays a column of row numbers (1-based).","extends":"yii2\\extensions\\csvexport\\Column","implements":["yii\\base\\Configurable"],"properties":{"header":{"type":"string|null","default":"'#'","description":"The header for the serial column."}},"methods":{"renderDataCellContent":{"signature":"public function renderDataCellContent(mixed $model, mixed $key, int $index): int","summary":"Renders the one-based row number.","params":[{"name":"$model","type":"mixed","description":"Data row; not used."},{"name":"$key","type":"mixed","description":"Key associated with the data row; not used."},{"name":"$index","type":"int","description":"Zero-based row index across the export."}],"return":{"type":"int","description":"The row number, starting at 1 and continuing across batches and files."}}},"inherited":{"properties":{"content":"yii2\\extensions\\csvexport\\Column","footer":"yii2\\extensions\\csvexport\\Column","grid":"yii2\\extensions\\csvexport\\Column","visible":"yii2\\extensions\\csvexport\\Column"},"methods":{"__call":"yii\\base\\BaseObject","__construct":"yii\\base\\BaseObject","__get":"yii\\base\\BaseObject","__isset":"yii\\base\\BaseObject","__set":"yii\\base\\BaseObject","__unset":"yii\\base\\BaseObject","canGetProperty":"yii\\base\\BaseObject","canSetProperty":"yii\\base\\BaseObject","className":"yii\\base\\BaseObject","getGrid":"yii2\\extensions\\csvexport\\Column","hasMethod":"yii\\base\\BaseObject","hasProperty":"yii\\base\\BaseObject","init":"yii\\base\\BaseObject","renderFooterCellContent":"yii2\\extensions\\csvexport\\Column","renderHeaderCellContent":"yii2\\extensions\\csvexport\\Column","setGrid":"yii2\\extensions\\csvexport\\Column"}}},"yii2\\extensions\\csvexport\\exception\\Message":{"kind":"enum","url":"https://yii2-framework.github.io/docs/extensions/csv-export/reference/exception/message/","summary":"Defines CSV export exception message templates.","backingType":"string","cases":{"ARCHIVER_RESULT_INVALID":{"value":"'The archiver must return a readable file in the private export directory.'","description":"Error when the archiver returns a source CSV or a path that is not a readable file in the export directory."},"COLUMN_CLASS_INVALID":{"value":"'Every configured export column must extend Column.'","description":"Error when a configured export column does not extend the base column class."},"COLUMN_EXPORTER_NOT_ASSIGNED":{"value":"'Assign the column to an exporter before rendering.'","description":"Error when a column is rendered before it is assigned to an exporter."},"COLUMN_FORMAT_INVALID":{"value":"'The column must be specified in the format of \"attribute\", \"attribute:format\" ' . 'or \"attribute:format:label\"'","description":"Error when a column shortcut does not match the `attribute:format:label` format."},"COLUMN_ROW_INVALID":{"value":"'Reading a column attribute requires an array or object row.'","description":"Error when a column attribute is read from a row that is neither an array nor an object."},"CSV_BOM_ENCODING_MISMATCH":{"value":"'The BOM must match the CSV output encoding.'","description":"Error when the configured BOM does not match the CSV output encoding."},"CSV_CELL_INVALID":{"value":"'CSV cells must be scalar, null or stringable.'","description":"Error when a CSV cell value is neither scalar, `null` nor stringable."},"CSV_DIALECT_INVALID":{"value":"'Use distinct single-byte CSV delimiters and an LF, CR or CRLF line ending.'","description":"Error when the CSV delimiters or the line ending are invalid."},"CSV_ENCODING_UNSUPPORTED":{"value":"'Choose UTF-8, UTF-16LE or UTF-16BE for CSV output.'","description":"Error when the CSV output encoding is not supported."},"CSV_FINALIZE_FAILED":{"value":"'Unable to finalize CSV \"%s\".'","description":"Error when the CSV stream cannot be flushed or released."},"CSV_NOT_OPEN":{"value":"'Open the CSV before writing.'","description":"Error when content is written before the CSV stream is opened."},"CSV_NOT_WRITABLE":{"value":"'The CSV is no longer writable.'","description":"Error when a closed or failed CSV is written to."},"CSV_OPEN_FAILED":{"value":"'Unable to open CSV \"%s\".'","description":"Error when the CSV stream cannot be opened."},"CSV_SPREADSHEET_SAFE_REQUIRES_UTF8":{"value":"'Spreadsheet-safe CSV requires UTF-8 text.'","description":"Error when spreadsheet-safe escaping receives text that is not valid UTF-8."},"CSV_TRANSCODING_REQUIRES_UTF8":{"value":"'Transcoding requires UTF-8 input.'","description":"Error when transcoding receives content that is not valid UTF-8."},"CSV_UNQUOTED_CELL_INVALID":{"value":"'An unquoted cell cannot contain a delimiter or line break.'","description":"Error when an unquoted CSV cell contains a delimiter or a line break."},"CSV_WRITE_INCOMPLETE":{"value":"'Unable to complete write to CSV \"%s\".'","description":"Error when the CSV stream stops accepting bytes before the content is written."},"DATA_PROVIDER_KEYS_MISMATCH":{"value":"'The data provider must return one key for each model.'","description":"Error when the data provider returns a different number of keys and models."},"DATA_SOURCE_NOT_CONFIGURED":{"value":"'Configure a data provider or a query before exporting.'","description":"Error when neither a data provider nor a query is configured."},"DOWNLOAD_NAME_INVALID":{"value":"'Use a download name without path separators or control characters.'","description":"Error when the download name is empty or contains path separators or control characters."},"EXPORT_BASE_NAME_INVALID":{"value":"'Use a simple file base name for the export.'","description":"Error when the export file base name is not a simple file name."},"EXPORT_CSV_INVALID":{"value":"'The export contains a missing, incomplete or unowned CSV.'","description":"Error when the export contains a CSV that is missing, incomplete or outside the private export directory."},"EXPORT_DESTINATION_INSIDE_WORKSPACE":{"value":"'Deliver the export outside its private workspace.'","description":"Error when the delivery destination is inside the private export directory."},"EXPORT_DESTINATION_PREPARE_FAILED":{"value":"'Unable to prepare the destination for the export.'","description":"Error when the delivery destination directory cannot be prepared."},"EXPORT_DIRECTORY_ALREADY_ALLOCATED":{"value":"'The private export directory is already allocated.'","description":"Error when the parent directory is set after the private export directory is allocated."},"EXPORT_DIRECTORY_CREATE_FAILED":{"value":"'Unable to create a private export directory.'","description":"Error when the private export directory cannot be created."},"EXPORT_DIRECTORY_IDENTIFY_FAILED":{"value":"'Unable to identify the private export directory.'","description":"Error when the identity of the private export directory cannot be read."},"EXPORT_DIRECTORY_REMOVE_FAILED":{"value":"'Unable to remove the private export directory.'","description":"Error when the private export directory remains after cleanup."},"EXPORT_LEASE_CREATE_FAILED":{"value":"'Unable to create the export lease.'","description":"Error when the export lease file cannot be created."},"EXPORT_PARENT_DIRECTORY_READ_FAILED":{"value":"'Unable to read the export parent directory.'","description":"Error when the export parent directory cannot be listed."},"EXPORT_RETENTION_NOT_POSITIVE":{"value":"'Export retention must be positive.'","description":"Error when the export retention age is not positive."},"EXPORT_STAGE_FAILED":{"value":"'Unable to stage the export.'","description":"Error when the staging file for the export cannot be created."},"EXPORT_STAGE_OUTSIDE_DESTINATION":{"value":"'Unable to stage the export beside its destination.'","description":"Error when the staging file is created outside the destination directory."},"EXPORT_WORKSPACE_LOCK_FAILED":{"value":"'Unable to lock the export workspace.'","description":"Error when the export workspace cannot be locked."},"EXPORT_WORKSPACE_PREPARE_FAILED":{"value":"'Unable to prepare the export workspace.'","description":"Error when the export base directory cannot be created or resolved."},"FILE_ROW_LIMIT_TOO_SMALL":{"value":"'The file limit must fit the header, footer and at least one data row.'","description":"Error when the per-file row limit cannot fit the header, footer and one data row."},"FORMATTER_NOT_CONFIGURED":{"value":"'Configure a Yii formatter before exporting formatted data.'","description":"Error when formatted data is exported without a Yii application formatter."},"INFERRED_COLUMN_NAME_INVALID":{"value":"'Inferred column names must be strings or integers.'","description":"Error when an inferred column name is neither a string nor an integer."},"PAGINATION_NOT_CLONED":{"value":"'A custom data provider must clone its pagination for export.'","description":"Error when a custom data provider returns its own pagination instead of a clone."},"QUERY_BATCH_ROWS_NOT_ITERABLE":{"value":"'Each query batch must contain iterable rows.'","description":"Error when a query batch is not iterable."},"QUERY_BATCH_SIZE_NOT_POSITIVE":{"value":"'The query batch size must be positive.'","description":"Error when the query batch size is not positive."},"QUERY_BATCHES_NOT_ITERABLE":{"value":"'The query must return iterable batches.'","description":"Error when the query batch method does not return an iterable."},"RESULT_CLASS_INVALID":{"value":"'The configured result must extend ExportResult.'","description":"Error when the configured result class does not extend the export result class."},"SEND_REQUIRES_WEB_RESPONSE":{"value":"'Sending a CSV requires a Yii web response.'","description":"Error when a completed export is sent without a Yii web application."},"SEND_RESULT_MISSING":{"value":"'There is no completed export to send.'","description":"Error when there is no completed export to send."},"WRITER_CLASS_INVALID":{"value":"'The configured writer must extend CsvFile.'","description":"Error when the configured writer class does not extend the CSV writer class."},"ZIP_ADD_MEMBER_FAILED":{"value":"'Unable to add a member to the export ZIP.'","description":"Error when a member cannot be added to the export ZIP."},"ZIP_EXTENSION_MISSING":{"value":"'Install ext-zip or configure an export archiver.'","description":"Error when neither ext-zip nor a custom export archiver is available."},"ZIP_FINALIZE_FAILED":{"value":"'Unable to finalize the export ZIP.'","description":"Error when the export ZIP cannot be closed."},"ZIP_OPEN_FAILED":{"value":"'Unable to open the export ZIP.'","description":"Error when the export ZIP cannot be opened."},"ZIP_PUBLISH_FAILED":{"value":"'Unable to publish the completed export ZIP.'","description":"Error when the staged export ZIP cannot be moved to its final path."}},"methods":{"getMessage":{"signature":"public function getMessage(int|string ...$argument): string","summary":"Returns the formatted message string for the error case.","params":[{"name":"$argument","type":"int|string","optional":true,"variadic":true,"description":"Values to insert into the message template."}],"return":{"type":"string"}}}}}}
