Hi, there,
I'm making a seed with this example below:
Code:
$formatters = [
'raison_social' => 'sentence',
'nom' => 'sentence',
'prenom' => 'sentence',
'email' => 'email',
];
$fabricator = new Fabricator(CustomerModel::class, $formatters);
for ($i = 0; $i < 5; $i++) {
$data[] = $fabricator->make();
$data[$i]->uuid = newUUID();
$data[$i]->code_client = 'xfgsdfgfdsgsdfg';
$data[$i]->id_country = 8;
$data[$i]->type = 1;
$data[$i]->reference = "fsgdsfgfdg";
$data[$i]->corp_rateCategory = 1;
$data[$i]->active = 1;
$data[$i]->order = $i + 1;
}
print_r($data);
$this->db->table('customers')->insertBatch($data);
But if I leave in my Model :
PHP Code:
protected $returnType = Customer::class;
This does not work, i.e. the database is populated but without the right information.
If I replace it with
it works perfectly.
In my entity I have nothing.
Do you have an idea?
Thanks