Appearance
RowWriter
php
interface StanislasPoisson\FrenchPostalCode\Core\RowWriterWhat 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): intCounts the rows of a table.
linkReplacedCities()
php
public function linkReplacedCities(array $links): voidSets replaced_by_city_id of cities that already exist, once every city exists. Only the rows whose value differs are written.
| Parameter | Description |
|---|---|
$links | identifier of a city => identifier of the city that replaces it |
transaction()
php
public function transaction(callable $callback): voidRuns the callback in a transaction: either everything it writes is kept, or nothing.
upsert()
php
public function upsert(string $table, array $rows, array $updateColumns): voidInserts the rows, or updates the columns listed in $updateColumns of those whose id exists.