Welcome Guest, Not a member yet? Register   Sign In
UUID bug with Entity
#1

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
PHP Code:
$returnType      "Object"


it works perfectly.
In my entity I have nothing.
Do you have an idea?

Thanks
Reply


Messages In This Thread
UUID bug with Entity - by FabriceL - 05-31-2023, 12:24 PM
RE: UUID bug with Entity - by InsiteFX - 05-31-2023, 11:11 PM
RE: UUID bug with Entity - by kenjis - 06-01-2023, 04:10 AM
RE: UUID bug with Entity - by FabriceL - 06-01-2023, 11:54 AM
RE: UUID bug with Entity - by kenjis - 06-01-2023, 04:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB