*/ final class ItemMapper extends DataMapperFactory { /** * Columns. * * @var array * @since 1.0.0 */ public const COLUMNS = [ {$columns} ]; /** * Primary table. * * @var string * @since 1.0.0 */ public const TABLE = '{$table}'; /** * Primary field name. * * @var string * @since 1.0.0 */ public const PRIMARYFIELD = '{$primaryfield}'; /** * Has many relation. * * @var array * @since 1.0.0 */ public const HAS_MANY = [ ]; } MAPPER; \file_put_contents($output . $name . 'Mapper.php', $mapper); //////////// Create model $model = <<< MODEL $this->id, ]; } /** * {@inheritdoc} */ public function jsonSerialize() : mixed { return $this->toArray(); } } MODEL; \file_put_contents($output . $name . '.php', $model); //////////// Create null model $nullmodel = <<< NULLMODEL id = $id; } /** * {@inheritdoc} */ public function jsonSerialize() : mixed { return ['id' => $this->id]; } } NULLMODEL; \file_put_contents($output . 'Null' . $name . '.php', $nullmodel);