Skip to content

v2.8.0

Latest

Choose a tag to compare

@yuriizee yuriizee released this 16 Oct 18:53
v2.8.0
8c280cc

Added

  • vendor/bin/sdo-generate <sample.json|sample.xml|-> <output-dir> generates data object classes from a sample document: one class per object shape, with property types, nested DTOs, #[DataCollection] lists and key mapping (#[TransformKeys], #[MapPropertyName], XML attributes / text / elements) inferred from the values. --optional makes keys missing from some objects T|Optional, so the sample round-trips exactly.
  • DataClassGenerator::fromValue() and write() do the same for any PHP array or object.
  • make:data --from-json, --from-xml and --from-model=Order --id=1 --with=items: the last generates from a real record, with loaded relations as nested classes.

See Generating classes from a sample.

Fully backward compatible with 2.7.x.