Skip to content

Dataset ​

php
final class StanislasPoisson\FrenchPostalCode\Core\Dataset

Reads the data files shipped with the package, without any framework.

Each table is a CSV file with a header. An empty value is read as null. The manifest announces the columns and the number of rows of every file, and the reader checks them: a truncated or altered file is an error, not a silent partial load.

Source: src/Core/Dataset.php

Constants ​

NameValueDescription
TABLES['regions', 'departments', 'communes', 'cities', 'commune_successions']The tables, in the order they must be loaded: a table comes after the tables it refers to.

Methods ​

__construct() ​

php
public function __construct(string $directory = …, string $schemas = …)

chunks() ​

php
public function chunks(string $table, int $size = 1000): Generator

The rows of a table, in blocks, for the loaders that write them in several statements.

Returns Generator<int, list<array<string, string|null>>>

columns() ​

php
public function columns(string $table): array

Returns list<string>

count() ​

php
public function count(string $table): int

manifest() ​

php
public function manifest(): array

The versions of the sources the data was built from, and the date of the export.

Returns Manifest

path() ​

php
public function path(string $table): string

rows() ​

php
public function rows(string $table): Generator

The rows of a table, one at a time, indexed by column name.

Returns Generator<int, array<string, string|null>>

tables() ​

php
public function tables(): array

Returns list<string>

types() ​

php
public function types(string $table): array

The Table Schema type of each column of a table (integer, number, date or string).

Returns array<string, string>

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