Repository navigation
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.--optionalmakes keys missing from some objectsT|Optional, so the sample round-trips exactly.DataClassGenerator::fromValue()andwrite()do the same for any PHP array or object.make:data --from-json,--from-xmland--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.