GravityKit\GravityMigrate\Media\FileCollector
Works out which files on disk the forms and entries in an export point at, and how many of
them fit inside the bundle.
The two sources are scoped differently. Entry uploads live in entry meta and belong to a submission, so they are bounded by whatever bounded the entries -- the selected forms and the date range. Image Choice images live in the form's own field definitions, so a form with no entries at all still carries them and no entry filter applies.
Since: %ver%
Source: src/Media/FileCollector.php:24
Details
- Kind:
class - Namespace:
GravityKit\GravityMigrate\Media
Methods
| Method | Description |
|---|---|
__construct() | |
collect() | The files an export should carry, and what did not fit. |
budget() | The total bytes of files a bundle may carry. |
Method Reference
__construct()
public function __construct( ?Util $util=null )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$util | Util | null | null | Utility instance. Defaults to the shared one. |
Since: %ver%
Source: src/Media/FileCollector.php:64
collect()
public function collect( array $form_ids, array $export_data, string $entry_meta_where='', ?int $budget_bytes=null ): array
The files an export should carry, and what did not fit.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_ids | int[] | Forms being exported. | |
$export_data | array | Data types the export was asked for. | |
$entry_meta_where | string | '' | The export's own WHERE clause for the entry meta table, so the files collected are exactly the files the exported entries reference. Must arrive already escaped. |
$budget_bytes | int | null | null | Maximum total bytes. Defaults to \self::budget(). |
Returns
array{included:string,excluded:string,included_size:int,excluded_size:int,total:int}
Since: %ver%
Source: src/Media/FileCollector.php:82
budget()
public static function budget(): int
The total bytes of files a bundle may carry.
Returns
int— Bytes.
Since: %ver%
Source: src/Media/FileCollector.php:132