Skip to content

RowWriter ​

php
interface StanislasPoisson\FrenchPostalCode\Core\RowWriter

What the loader needs from a database layer. Each adapter (Eloquent, Doctrine) provides one.

Source: src/Core/RowWriter.php

Methods ​

count() ​

php
public function count(string $table): int

Counts the rows of a table.

linkReplacedCities() ​

php
public function linkReplacedCities(array $links): void

Sets replaced_by_city_id of cities that already exist, once every city exists. Only the rows whose value differs are written.

ParameterDescription
$linksidentifier of a city => identifier of the city that replaces it

transaction() ​

php
public function transaction(callable $callback): void

Runs the callback in a transaction: either everything it writes is kept, or nothing.

upsert() ​

php
public function upsert(string $table, array $rows, array $updateColumns): void

Inserts the rows, or updates the columns listed in $updateColumns of those whose id exists.

Documentation of next , built from 068662f on main by pipeline #37508150537 on 2026-10-06.