import:listing.data_before_save
Filters listing data during CSV import before saving to database. Custom fields are in $data['fields'] as arrays (converted from asterisk format). Standard fields are at root level. Must return data with same structure.
You need to have a working knowledge of Hooks before you get started.
Fires during CSV import after data transformation but before saving listing
Parameters
| Name | Type | Description |
|---|---|---|
$data |
array |
Data array with standard fields at root and custom fields in 'fields' key as arrays |
$listing |
\JReviews\App\Models\Listing|null |
The listing being updated (null for new listings) |
Boilerplate Code
Use the boilerplate code to start using the filter, and add your own logic to modify the first argument and return it.
fwd_add_filter('import:listing.data_before_save', function($data, $listing)
{
// Your code here
return $data;
});
Source Files
app/Actions/HandleListingImportJobAction.php